:root {
  --page-max-width: 1440px;
  --bg-0: #010205;
  --bg-1: #030811;
  --bg-2: #08101d;
  --panel: rgba(6, 10, 18, 0.94);
  --panel-2: rgba(8, 13, 24, 0.97);
  --border: rgba(69, 99, 150, 0.22);
  --text: #edf4ff;
  --muted: #8594ad;
  --text-muted: #8594ad;
  --accent: #e88731;
  --accent-2: #ffb36c;
  --good: #7ec7ff;
  --warn: #f0c46b;
  --bad: #f08282;
  --shadow: 0 22px 72px rgba(0, 0, 0, 0.58);
  --scrollbar-thumb: linear-gradient(180deg, rgba(255, 179, 108, 0.74), rgba(232, 135, 49, 0.48));
  --scrollbar-thumb-hover: linear-gradient(180deg, rgba(255, 196, 140, 0.9), rgba(232, 135, 49, 0.7));
  --scrollbar-track: rgba(5, 9, 16, 0.78);
  --scrollbar-border: rgba(4, 7, 14, 0.94);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body.statistics-map-modal-open {
  overflow: hidden;
}

body[data-auth-pending="true"] .topbar-actions,
body[data-auth-pending="true"][data-auth-shell="protected"] main,
body[data-auth-pending="true"][data-auth-shell="protected"] .footer,
body[data-auth-pending="true"] .message-widget-launcher {
  visibility: hidden;
}

body[data-auth-pending="true"][data-auth-shell="protected"]::after {
  content: "Loading...";
  position: fixed;
  inset: auto 50% 2rem auto;
  transform: translateX(50%);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 135, 49, 0.22);
  background: rgba(7, 12, 22, 0.94);
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  z-index: 100;
}

body {
  min-height: 100vh;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(42, 84, 146, 0.18), transparent 18%),
    radial-gradient(circle at 84% 18%, rgba(34, 63, 109, 0.14), transparent 20%),
    radial-gradient(circle at 86% 78%, rgba(255, 184, 96, 0.08), transparent 14%),
    radial-gradient(circle at 48% 100%, rgba(10, 25, 51, 0.34), transparent 24%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 52%, var(--bg-2));
}

html {
  scrollbar-color: rgba(232, 135, 49, 0.82) rgba(7, 12, 10, 0.6);
  scrollbar-width: thin;
}

* {
  scrollbar-color: rgba(232, 135, 49, 0.82) rgba(7, 12, 10, 0.6);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--scrollbar-thumb);
  border: 2px solid var(--scrollbar-border);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

.topbar,
main,
.footer {
  position: relative;
  z-index: 1;
}

.topbar {
  z-index: 20;
  width: min(var(--page-max-width), calc(100% - 1.5rem));
  margin: 0.75rem auto 0;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(5, 9, 18, 0.88);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  overflow: visible;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(232, 135, 49, 0.55);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  overflow: visible;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0.35rem;
}

.topnav a:hover {
  color: var(--text);
}

.topnav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 30;
  padding-bottom: 0.45rem;
  margin-bottom: -0.45rem;
}

.topnav-dropdown-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  padding: 0.25rem 0.35rem;
  cursor: pointer;
}

.topnav-dropdown-trigger:hover,
.topnav-dropdown-trigger:focus-visible {
  color: var(--text);
}

.topnav-dropdown-menu {
  position: absolute;
  top: calc(100% - 0.05rem);
  left: 0;
  z-index: 70;
  min-width: 13rem;
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem;
  border-radius: 14px;
  border: 1px solid rgba(84, 117, 173, 0.16);
  background: rgba(5, 9, 18, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

.topnav-dropdown:hover .topnav-dropdown-menu,
.topnav-dropdown.is-open .topnav-dropdown-menu,
.topnav-dropdown:focus-within .topnav-dropdown-menu {
  display: flex;
}

.topnav-dropdown-menu a {
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  color: var(--text);
  text-decoration: none;
}

.topnav-dropdown-menu a:hover,
.topnav-dropdown-menu a:focus-visible {
  background: rgba(90, 130, 194, 0.1);
}

.topnav-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(76, 110, 163, 0.18);
  background: rgba(17, 24, 37, 0.88);
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.topnav-icon-link svg {
  width: 1.66rem;
  height: 1.66rem;
  stroke: currentColor;
  stroke-width: 2.15;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topnav-icon-link:hover,
.topnav-icon-link:focus-visible {
  color: var(--text);
  background: rgba(56, 85, 132, 0.2);
  border-color: rgba(109, 159, 233, 0.28);
  transform: translateY(-1px);
}

.topnav-icon-link:focus-visible {
  outline: 2px solid rgba(88, 140, 214, 0.45);
  outline-offset: 2px;
}

.topnav-icon-badge {
  position: absolute;
  top: -0.1rem;
  right: -0.2rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.22rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #d86b3a;
  color: #fff7ef;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(4, 8, 16, 0.95);
  pointer-events: none;
}

.header-icon-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 35;
  padding-bottom: 0.45rem;
  margin-bottom: -0.45rem;
}

.header-icon-dropdown {
  position: absolute;
  top: calc(100% - 0.05rem);
  right: 0;
  z-index: 70;
  min-width: min(22rem, calc(100vw - 1.5rem));
  max-height: min(36rem, calc(100vh - 6rem));
  display: none;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid rgba(84, 117, 173, 0.16);
  background: rgba(5, 9, 18, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

.header-icon-menu:hover .header-icon-dropdown,
.header-icon-menu.is-open .header-icon-dropdown,
.header-icon-menu:focus-within .header-icon-dropdown {
  display: flex;
}

.header-notification-panel-head {
  padding: 0.2rem 0.3rem 0.35rem;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-notification-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.header-notification-delete-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}

.header-notification-delete-btn:hover,
.header-notification-delete-btn:focus-visible {
  background: rgba(186, 68, 52, 0.18);
  color: var(--text);
  opacity: 1;
}

.header-notification-delete-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.header-notification-item:hover,
.header-notification-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.header-notification-main {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  color: var(--text);
  text-decoration: none;
  padding-right: 1.8rem;
}

.header-notification-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 140ms ease, max-height 140ms ease;
}

.header-notification-item:hover .header-notification-actions,
.header-notification-item:focus-within .header-notification-actions {
  opacity: 1;
  max-height: 3rem;
}

.header-notification-item.has-actions .header-notification-actions {
  opacity: 1;
  max-height: 3rem;
  padding-top: 0.15rem;
}

.header-notification-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
}

.header-notification-action-btn:hover,
.header-notification-action-btn:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.header-notification-action-btn.is-accept {
  border-color: rgba(136, 180, 102, 0.34);
  background: rgba(136, 180, 102, 0.12);
}

.header-notification-action-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.header-notification-item.is-unread {
  border: 1px solid rgba(136, 180, 102, 0.22);
  background: rgba(136, 180, 102, 0.06);
}

.header-notification-copy {
  line-height: 1.3;
}

.header-notification-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.header-notification-more,
.header-notification-empty {
  margin: 0;
  padding: 0.55rem 0.7rem 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
}

main {
  width: min(var(--page-max-width), calc(100% - 1.5rem));
  margin: 0.9rem auto 2rem;
  display: grid;
  gap: 0.95rem;
}

.hero-card,
.panel {
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  border: 0;
  background:
    linear-gradient(180deg, rgba(2, 3, 7, 0.18), rgba(2, 4, 8, 0.88)),
    radial-gradient(circle at 18% 16%, rgba(53, 93, 156, 0.16), transparent 30%),
    radial-gradient(circle at 82% 24%, rgba(31, 54, 93, 0.12), transparent 32%),
    linear-gradient(180deg, #050911, #02050b);
  background-size: cover;
  background-position: center top;
}

.hero-banner {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.hero-banner::before,
.hero-banner::after {
  content: "";
  position: absolute;
  inset: -12%;
  pointer-events: none;
}

.hero-banner::before {
  z-index: 0;
  background:
    radial-gradient(circle at 18% 28%, rgba(76, 122, 201, 0.18), transparent 20%),
    radial-gradient(circle at 78% 24%, rgba(232, 135, 49, 0.1), transparent 20%),
    radial-gradient(circle at 58% 68%, rgba(255, 255, 255, 0.04), transparent 16%);
  opacity: 0.55;
  animation: heroAmbientDrift 16s ease-in-out infinite alternate;
}

.hero-banner::after {
  z-index: 0;
  background: linear-gradient(115deg, transparent 18%, rgba(122, 168, 238, 0.05) 50%, transparent 82%);
  opacity: 0.1;
  transform: translate3d(-12%, 0, 0);
  animation: heroLightSweep 14s ease-in-out infinite;
}

.hero-banner-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(126, 171, 243, 0.06), transparent 22%),
    linear-gradient(180deg, rgba(3, 6, 12, 0.28), rgba(3, 7, 14, 0.72));
  animation: heroOverlayPulse 8s ease-in-out infinite;
}

.hero-card.hero-card-clean,
.hero-card.hero-card-clean .hero-body {
  background: transparent;
}

.hero-card.hero-card-clean .hero-banner::before,
.hero-card.hero-card-clean .hero-banner::after,
.hero-card.hero-card-clean .hero-banner-overlay {
  display: none;
}

.hero-card.hero-card-clean .hero-body {
  background: linear-gradient(180deg, rgba(3, 7, 14, 0.68), rgba(3, 7, 14, 0.84));
  margin-top: 0;
  padding-top: 1.2rem;
  padding-bottom: 1.2rem;
}

.hero-logo-shell {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  animation: heroLogoFloat 6s ease-in-out infinite;
}

.hero-logo-shell.is-hidden,
.hero-logo.is-hidden {
  display: none;
}

.hero-logo-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(5.8rem, 14vw, 7.2rem);
  height: clamp(5.8rem, 14vw, 7.2rem);
  padding: 0.35rem;
  border-radius: 999px;
  overflow: hidden;
  border: 4px solid rgba(232, 135, 49, 0.56);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 196, 122, 0.3), transparent 32%),
    linear-gradient(145deg, rgba(14, 23, 38, 0.96), rgba(7, 11, 20, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 18px 36px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(232, 135, 49, 0.14);
}

.hero-logo-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 4px solid rgba(74, 106, 159, 0.4);
  z-index: 2;
}

.hero-logo-mask {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  overflow: hidden;
}

.hero-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  filter: none;
  transform: translateY(-1px) scale(1.34);
  transform-origin: center;
}

.hero-body {
  position: relative;
  z-index: 1;
  padding: 1.25rem 1.35rem 1.35rem;
  padding-right: min(34rem, 44vw);
  color: var(--text);
  background: rgba(4, 9, 18, 0.78);
  margin-top: -1px;
}

.eyebrow {
  display: none !important;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
}

.hero-body h1 {
  margin-top: 0;
  font-size: clamp(1.9rem, 3.4vw, 3.2rem);
}

.hero-copy {
  margin: 0.65rem 0 0;
  color: rgba(173, 189, 214, 0.86);
  max-width: 65ch;
  line-height: 1.5;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.verify-email-primary-actions {
  margin-top: 0.85rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.verify-email-secondary-actions {
  margin-top: 0.2rem;
  justify-content: center;
}

.verify-email-panel {
  text-align: center;
}

.verify-email-panel .panel-header {
  justify-content: center;
}

.verify-email-panel .muted,
.verify-email-panel label,
.verify-email-panel #verifyEmailStatus {
  text-align: center;
}

.verify-email-code-form {
  justify-items: center;
}

.verify-email-code-form label {
  width: min(100%, 22rem);
}

.verify-email-code-form input {
  width: 100%;
  text-align: center;
}

.verify-email-panel .footer,
.verify-email-panel .eyebrow {
  display: none;
}

.hero-actions {
  margin-top: 0.85rem;
}

.hero-status-row {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-tracker-panel {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 2;
  width: min(30rem, 39vw);
}

.hero-tracker-panel .tracker-card {
  margin: 0;
  padding: 1rem 1.05rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.015), rgba(136, 180, 102, 0.03)),
    rgba(9, 12, 11, 0.68);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(6px);
}

.hero-tracker-panel .tracker-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.hero-tracker-panel .tracker-copy {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}

.hero-tracker-panel .tracker-count {
  flex-shrink: 0;
  text-align: right;
  font-size: clamp(2.2rem, 4.8vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--good);
}

.hero-tracker-panel .tracker-count[data-state="online"] {
  color: var(--good);
}

.hero-tracker-panel .tracker-count[data-state="offline"] {
  color: rgb(214, 96, 82);
}

.hero-tracker-panel .tracker-count[data-state="unknown"] {
  color: rgba(239, 244, 236, 0.84);
}

.hero-tracker-panel #trackerSource {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 700;
  color: rgba(239, 244, 236, 0.96);
}

.hero-tracker-panel #trackerWipe {
  margin: 0;
  font-size: 0.98rem;
  color: rgba(239, 244, 236, 0.78);
}

/* BM-426: second server row (creative) inside the hero tracker card */
.hero-tracker-panel .tracker-main + .tracker-main {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-tracker-panel .tracker-secondary .tracker-source {
  margin: 0;
  font-size: clamp(1.05rem, 1.9vw, 1.3rem);
  font-weight: 700;
  color: rgba(239, 244, 236, 0.96);
}

.hero-tracker-panel .tracker-secondary .tracker-sub {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(239, 244, 236, 0.78);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.85rem;
}

.section-grid {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: 1.1fr 1fr;
}

.full-span {
  grid-column: 1 / -1;
}

#account {
  grid-column: 1 / -1;
}

.panel {
  padding: 1.1rem;
  background: var(--panel-2);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.panel-header h2 {
  margin-top: 0;
}

.tracker-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(74, 106, 159, 0.22);
  background: rgba(12, 18, 31, 0.86);
}

.tracker-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

.tracker-label {
  color: var(--muted);
}

.tracker-count {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--good);
}

.server-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.6rem;
}

.server-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.server-meta {
  display: grid;
  gap: 0.15rem;
}

.server-name {
  font-weight: 600;
}

.server-status {
  color: var(--muted);
  font-size: 0.85rem;
}

.server-online {
  font-weight: 700;
  color: var(--text);
}

.feature-cards {
  display: grid;
  gap: 0.65rem;
}

.feature-card {
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.85rem 0.9rem;
  background: rgba(255, 255, 255, 0.02);
}

.feature-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
}

.feature-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.homepage-stack {
  display: grid;
  gap: 1rem;
  width: 100%;
  margin: 0 0 1rem;
}

.panel-header-centered {
  justify-content: center;
  text-align: center;
}

.panel-header-centered-copy {
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  width: 100%;
}

.panel-home-announcements {
  width: 100%;
  justify-self: stretch;
  padding-top: 2rem;
  padding-bottom: 2rem;
  background:
    radial-gradient(circle at 50% -10%, rgba(232, 135, 49, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(13, 19, 32, 0.96), rgba(8, 13, 24, 0.94)),
    var(--panel-2);
}

.panel-home-features {
  width: 100%;
}

.panel-home-features .feature-cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
}

.panel-home-features .feature-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.8rem;
  min-height: 14rem;
  padding: 1rem 1rem 0.95rem;
  background:
    radial-gradient(circle at top right, rgba(232, 135, 49, 0.08), transparent 44%),
    rgba(255, 255, 255, 0.025);
}

.panel-home-features .feature-card-head {
  align-items: flex-start;
}

.panel-home-features .feature-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.15;
  max-width: 11ch;
}

.panel-home-features .feature-card p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.5;
}

.panel-home-features .feature-card .btn {
  justify-self: start;
  min-width: 7rem;
}

.tongs-panel-crest {
  margin-bottom: 0.25rem;
}

.tongs-panel-crest-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 8.25rem;
  height: 8.25rem;
  padding: 0.45rem;
  border-radius: 999px;
  overflow: hidden;
  border: 4px solid rgba(232, 135, 49, 0.56);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 196, 122, 0.3), transparent 32%),
    linear-gradient(145deg, rgba(14, 23, 38, 0.96), rgba(7, 11, 20, 0.98));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 18px 36px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(232, 135, 49, 0.14);
}

.tongs-panel-crest-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 4px solid rgba(74, 106, 159, 0.4);
  z-index: 2;
}

.tongs-panel-crest-mask {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  overflow: hidden;
}

.tongs-panel-crest-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateY(-1px) scale(1.34);
  transform-origin: center;
}

.panel-home-announcements .panel-header h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.08;
}

.announcement-list {
  display: grid;
  gap: 0.7rem;
}

.announcement-item {
  display: grid;
  gap: 0.45rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.9rem;
  background:
    radial-gradient(circle at 85% 20%, rgba(232, 135, 49, 0.08), transparent 40%),
    rgba(255, 255, 255, 0.02);
}

.announcement-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.announcement-item h3 {
  margin: 0;
  font-size: 1.725rem;
  line-height: 1.2;
}

.announcement-item p {
  margin: 0.35rem 0 0;
  font-size: 1.5rem;
  line-height: 1.45;
}

.announcement-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 1.425rem;
}

.announcement-actions {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.feature-status {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-status.active {
  color: var(--good);
  border-color: rgba(159, 220, 129, 0.22);
}

.feature-status.planned {
  color: var(--warn);
  border-color: rgba(240, 196, 107, 0.2);
}

.account-layout {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-layout-single {
  grid-template-columns: minmax(0, 720px);
  justify-content: start;
}

.account-layout-centered {
  justify-content: center;
}

.account-card {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
}

.account-layout-single .account-card {
  padding: 1.15rem 1.15rem 1.05rem;
}

.account-layout-single .stack-form {
  gap: 0.85rem;
}

.account-layout-single .account-cta-block {
  margin-top: 1rem;
}

.account-card h3 {
  margin-bottom: 0.3rem;
}

.account-cta-block {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 0.5rem;
  justify-items: start;
}

.account-cta-block p {
  margin: 0;
}

.account-session-card {
  background:
    radial-gradient(circle at 80% 18%, rgba(232, 135, 49, 0.08), transparent 45%),
    rgba(255, 255, 255, 0.02);
}

.account-session-head {
  display: flex;
  gap: 0.7rem;
  justify-content: space-between;
  align-items: flex-start;
}

.account-session-head .feature-status {
  flex-shrink: 0;
}

.account-session-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.account-session-row:last-child {
  border-bottom: 0;
}

.account-premium-package {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid rgba(232, 135, 49, 0.26);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(232, 135, 49, 0.12), rgba(76, 190, 221, 0.05)),
    rgba(255, 255, 255, 0.03);
}

.account-premium-package[hidden] {
  display: none;
}

.account-premium-package strong {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 1.05rem;
  color: var(--text);
}

.account-premium-package p {
  margin: 0;
  color: var(--muted);
}

.account-premium-package > span {
  color: var(--warn);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.ticket-layout {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: 0.95fr 1.05fr;
}

.ticket-form-wrap,
.ticket-chat-wrap {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
}

.ticket-form-wrap h3,
.ticket-chat-wrap h3 {
  margin-bottom: 0.3rem;
}

/* Ticket-type switch: two buttons that reveal the Appeal or Support/Report
   panel. CSS-only (radio + general-sibling) so it stays CSP-safe (no inline JS). */
.ticket-type-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ticket-type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.ticket-type-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  margin: 0;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(92, 125, 182, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(19, 29, 45, 0.92), rgba(16, 24, 36, 0.98));
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.ticket-type-tab:hover {
  color: var(--text);
  border-color: rgba(232, 135, 49, 0.28);
  transform: translateY(-1px);
}

.ticket-panel {
  display: none;
}

#ticketTypeAppeal:checked ~ #ticketAppealPanel,
#ticketTypeSupport:checked ~ #ticketSupportPanel {
  display: block;
}

#ticketTypeAppeal:checked ~ .ticket-type-switch label[for="ticketTypeAppeal"],
#ticketTypeSupport:checked ~ .ticket-type-switch label[for="ticketTypeSupport"] {
  color: var(--text);
  border-color: rgba(232, 135, 49, 0.42);
  background:
    radial-gradient(circle at 50% -10%, rgba(232, 135, 49, 0.16), transparent 52%),
    linear-gradient(180deg, rgba(23, 34, 53, 0.98), rgba(18, 28, 45, 0.98) 32%, rgba(16, 24, 36, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

#ticketTypeAppeal:focus-visible ~ .ticket-type-switch label[for="ticketTypeAppeal"],
#ticketTypeSupport:focus-visible ~ .ticket-type-switch label[for="ticketTypeSupport"] {
  outline: 2px solid rgba(232, 135, 49, 0.55);
  outline-offset: 2px;
}

.stack-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

label {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 3.1rem;
  border-radius: 10px;
  border: 1px solid rgba(79, 110, 161, 0.18);
  background: rgba(20, 27, 40, 0.9);
  color: var(--text);
  padding: 0.7rem 0.8rem;
}

select {
  appearance: none;
  padding-right: 2.8rem;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(232, 235, 242, 0.92) 50%),
    linear-gradient(135deg, rgba(232, 235, 242, 0.92) 50%, transparent 50%),
    linear-gradient(180deg, rgba(36, 47, 68, 0.96), rgba(20, 27, 40, 0.96));
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 8px 18px rgba(4, 7, 12, 0.18);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(73, 117, 186, 0.22);
  border-color: rgba(232, 135, 49, 0.42);
}

.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.chat-messages {
  min-height: 290px;
  max-height: 420px;
  overflow: auto;
  display: grid;
  gap: 0.55rem;
  padding: 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(8, 13, 24, 0.82);
}

.chat-empty {
  color: var(--muted);
  margin: auto;
}

.chat-msg {
  display: grid;
  gap: 0.14rem;
  border-radius: 10px;
  padding: 0.34rem 0.48rem;
  border: 1px solid rgba(76, 110, 163, 0.16);
  background: rgba(14, 21, 34, 0.88);
  align-self: start;
  /* Don't let an attached image's intrinsic width force the bubble (and its
     grid track) wider than the chat card. */
  min-width: 0;
  max-width: 100%;
}

.chat-msg.user {
  border-color: rgba(232, 135, 49, 0.17);
  background: rgba(232, 135, 49, 0.06);
}

.chat-msg.staff {
  border-color: rgba(76, 146, 218, 0.2);
  background: rgba(39, 79, 131, 0.14);
}

.chat-msg.system {
  border-style: dashed;
  color: var(--muted);
}

.chat-msg-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.15;
}

.chat-msg-body {
  white-space: pre-wrap;
  line-height: 1.28;
}

.chat-msg-body a {
  color: #f8c993;
  word-break: break-all;
}

.chat-msg-attachments {
  margin-top: 0.1rem;
  display: grid;
  gap: 0.2rem;
}

.chat-msg-attachments a {
  color: #f8c993;
  word-break: break-all;
}

.chat-reply-form {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.6rem;
}

/* Ticket list view (right panel): the user's tickets, each opening its chat. */
.ticket-list {
  min-height: 290px;
  max-height: 520px;
  overflow: auto;
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(8, 13, 24, 0.82);
}

.ticket-list .chat-empty {
  text-align: center;
  padding: 1.5rem 1rem;
}

.ticket-list-item {
  display: grid;
  gap: 0.3rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
  border: 1px solid rgba(76, 110, 163, 0.18);
  background: rgba(14, 21, 34, 0.9);
  color: var(--text);
  padding: 0.7rem 0.8rem;
  min-height: 0;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.ticket-list-item:hover,
.ticket-list-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(232, 135, 49, 0.36);
  background: rgba(20, 29, 45, 0.95);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  outline: none;
}

.ticket-list-item.is-closed {
  opacity: 0.72;
}

.ticket-list-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.ticket-list-item-title {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ticket-list-item-status {
  flex: none;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.ticket-list-item-status.is-open {
  color: #8fdca0;
  border-color: rgba(120, 200, 140, 0.35);
  background: rgba(64, 150, 90, 0.16);
}

.ticket-list-item-status.is-closed {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.ticket-list-item-preview {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ticket-list-item-meta {
  color: var(--muted);
  font-size: 0.72rem;
}

.ticket-detail-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.ticket-close-btn:hover,
.ticket-close-btn:focus-visible {
  border-color: rgba(220, 96, 76, 0.5);
  color: #f3b4a6;
}

.ticket-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ticket-back-arrow {
  font-size: 1.05em;
  line-height: 1;
}

.rules-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.7rem;
}

.rules-list li {
  line-height: 1.45;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  padding: 0.65rem 0.95rem;
  transition: transform 120ms ease, opacity 120ms ease, border-color 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #cc5b2d);
}

.btn-secondary {
  background: rgba(16, 24, 37, 0.88);
  border-color: rgba(76, 110, 163, 0.18);
}

.btn-small {
  padding: 0.45rem 0.75rem;
  font-size: 0.88rem;
}

.topbar-auth-btn {
  white-space: nowrap;
}

.topbar-auth-btn-text {
  white-space: nowrap;
}

.topbar-auth-btn-avatar {
  width: 2.7rem;
  min-width: 2.7rem;
  height: 2.7rem;
  padding: 0;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex: 0 0 2.7rem;
  position: relative;
}

.topbar-auth-avatar-image,
.topbar-auth-avatar-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
}

.topbar-auth-avatar-image {
  object-fit: cover;
  object-position: center;
}

.topbar-auth-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 197, 142, 0.24), transparent 52%),
    linear-gradient(180deg, rgba(232, 135, 49, 0.28), rgba(72, 114, 173, 0.24));
}

.topbar-auth-btn-plain {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.topbar-auth-btn-plain:hover,
.topbar-auth-btn-plain:focus-visible {
  background: transparent;
  border-color: transparent;
}

.global-admin-launcher {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(237, 127, 52, 0.44);
  border-radius: 999px;
  background: rgba(12, 18, 30, 0.9);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.global-admin-launcher:hover,
.global-admin-launcher:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(237, 127, 52, 0.78);
  background: rgba(18, 26, 42, 0.96);
}

/* BM-276 QA console launcher — bottom-left, sits above the admin launcher when both show. */
.global-qa-launcher {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(80, 140, 255, 0.44);
  border-radius: 999px;
  background: rgba(12, 18, 30, 0.9);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.global-qa-launcher.is-stacked {
  bottom: 4.25rem;
}

.global-qa-launcher:hover,
.global-qa-launcher:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(80, 140, 255, 0.78);
  background: rgba(18, 26, 42, 0.96);
}

.header-account-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 40;
  padding-bottom: 0.45rem;
  margin-bottom: -0.45rem;
}

.header-account-dropdown {
  position: absolute;
  top: calc(100% - 0.05rem);
  right: 0;
  z-index: 60;
  min-width: 11rem;
  display: none;
  flex-direction: column;
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid rgba(84, 117, 173, 0.16);
  background: rgba(5, 9, 18, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

.header-account-dropdown a {
  color: var(--text);
  text-decoration: none;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
}

.header-account-dropdown-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  text-align: left;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
}

.header-account-dropdown a:hover,
.header-account-dropdown a:focus-visible,
.header-account-dropdown-action:hover,
.header-account-dropdown-action:focus-visible {
  background: rgba(90, 130, 194, 0.1);
}

.header-account-menu.is-authenticated:hover .header-account-dropdown,
.header-account-menu.is-authenticated.is-open .header-account-dropdown,
.header-account-menu.is-authenticated:focus-within .header-account-dropdown {
  display: flex;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.88rem;
}

.footer {
  width: min(var(--page-max-width), calc(100% - 1.5rem));
  margin: 0 auto 2rem;
  color: var(--muted);
}

.footer p {
  margin: 0.25rem 0;
}

.footer a {
  color: var(--accent-2);
  text-decoration: none;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.account-page-shell {
  width: min(var(--page-max-width), calc(100% - 1.5rem));
  margin: 0.9rem auto 2rem;
  display: grid;
  gap: 0.95rem;
}

.profile-shell {
  width: min(var(--page-max-width), calc(100% - 1.5rem));
  margin: 0.9rem auto 2rem;
  display: grid;
  gap: 0.95rem;
}

.settings-shell {
  width: min(var(--page-max-width), calc(100% - 1.5rem));
  margin: 0.9rem auto 2rem;
  display: grid;
  gap: 0.95rem;
}

.settings-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

/* Each rail is a vertical stack of cards (BM-192 two-rail settings layout). */
.settings-col {
  display: grid;
  gap: 0.85rem;
  align-content: start;
  min-width: 0;
}

.settings-placeholder-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.settings-placeholder-list li + li {
  margin-top: 0.45rem;
}

.settings-toggle-row {
  display: grid;
  gap: 0.35rem;
  margin: 0.8rem 0 1rem;
  padding: 0.78rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
}

.settings-toggle-row label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
}

.settings-toggle-row input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.settings-toggle-row p {
  margin: 0;
}

.settings-danger-card {
  border-color: rgba(186, 68, 52, 0.35);
}

.settings-danger-copy {
  margin-bottom: 0.85rem;
}

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.1rem 1.25rem;
  align-items: start;
  padding: 1.35rem;
  background:
    radial-gradient(circle at top left, rgba(232, 135, 49, 0.08), transparent 26%),
    radial-gradient(circle at 82% 22%, rgba(74, 110, 175, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(8, 12, 21, 0.98), rgba(4, 8, 16, 0.96));
}

.profile-hero-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}

.profile-hero-lower {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.95rem;
}

.profile-hero-subpanel {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  min-height: 100%;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.015)),
    rgba(6, 10, 18, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.profile-hero-subpanel-head h2 {
  margin-top: 0.2rem;
}

.profile-avatar-wrap {
  position: relative;
  width: 88px;
  height: 88px;
}

.clan-avatar-editor {
  display: flex;
  justify-content: center;
  margin: 0 0 1rem;
}

.clan-avatar-wrap {
  width: 128px;
  height: 128px;
}

.clan-avatar-wrap .profile-avatar,
.clan-avatar-wrap .profile-avatar-fallback {
  width: 128px;
  height: 128px;
  border-radius: 22px;
  cursor: pointer;
}

.profile-avatar,
.profile-avatar-fallback {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar[hidden],
.profile-avatar-fallback[hidden],
.profile-avatar-edit-btn[hidden] {
  display: none !important;
}

.profile-avatar {
  object-fit: cover;
  background: rgba(255, 255, 255, 0.03);
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(232, 135, 49, 0.14), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(136, 180, 102, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.03);
}

/* User profile avatars are not clickable (derived from linked accounts), but
   clan avatars remain owner-editable, so the edit affordances below are still
   used by the clan avatar editor (see my-clans.html / clans.js). */
.profile-avatar-edit-btn {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 10, 9, 0.88);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
  z-index: 2;
  pointer-events: auto;
  transition: transform 120ms ease, opacity 120ms ease, border-color 120ms ease;
}

.profile-avatar-edit-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 135, 49, 0.35);
}

.profile-avatar-edit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.profile-hero-copy h1 {
  margin-top: 0.3rem;
}

.profile-hero-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
}

.profile-title-block {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.profile-title-chip,
.profile-title-select,
.profile-title-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 1.75rem;
  padding: 0.2rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 135, 49, 0.28);
  background: linear-gradient(180deg, rgba(61, 36, 12, 0.78), rgba(37, 24, 11, 0.92));
  color: #ffd7a9;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.profile-title-badge {
  min-height: 1.35rem;
  padding: 0.06rem 0.5rem;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  justify-self: start;
}

.profile-title-chip {
  cursor: default;
}

.profile-title-chip:disabled {
  cursor: default;
  opacity: 0.88;
}

.profile-title-select {
  appearance: none;
  color: var(--text);
  background: rgba(14, 20, 30, 0.96);
  min-width: min(18rem, 100%);
  padding-right: 2.2rem;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 215, 169, 0.95) 50%),
    linear-gradient(135deg, rgba(255, 215, 169, 0.95) 50%, transparent 50%);
  background-position:
    calc(100% - 0.92rem) calc(50% - 0.12rem),
    calc(100% - 0.68rem) calc(50% - 0.12rem);
  background-size: 0.32rem 0.32rem, 0.32rem 0.32rem;
  background-repeat: no-repeat;
  text-transform: none;
  font-size: 0.84rem;
  cursor: pointer;
}

.profile-title-block[hidden],
.profile-title-chip[hidden],
.profile-title-select[hidden],
#profileTitleStatus[hidden] {
  display: none !important;
}

.profile-hero-copy .hero-copy {
  margin-top: 0.45rem;
}

.profile-hero-bio {
  margin: 0.7rem 0 0;
  max-width: 82ch;
  line-height: 1.55;
  white-space: pre-wrap;
}

.profile-hero-bio.is-editable,
#profileHeroName.is-editable {
  cursor: pointer;
}

.profile-hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: min(24rem, 100%);
  width: min(24rem, 100%);
}

.profile-linked-accounts-card {
  width: 100%;
  min-height: auto;
  align-self: start;
  gap: 0.6rem;
}

/* Compact linked-account rows (avatar | name + platform | optional open link)
   so the card hugs its content instead of stacking and leaving blank space. */
.profile-linked-accounts-card .profile-social-list {
  display: grid;
  gap: 0.45rem;
}

.profile-linked-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.profile-linked-avatar {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-linked-avatar-fallback {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.profile-linked-avatar-fallback.is-discord {
  background: rgba(88, 101, 242, 0.28);
}

.profile-linked-avatar-fallback.is-steam {
  background: rgba(102, 192, 244, 0.2);
}

.profile-linked-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 0.05rem;
}

.profile-linked-name {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-linked-platform {
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.profile-linked-platform.is-discord {
  color: #9aa6f2;
}

.profile-linked-platform.is-steam {
  color: #8fb7d6;
}

.profile-linked-open {
  flex: none;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.32rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 140ms ease, border-color 140ms ease;
}

.profile-linked-open:hover,
.profile-linked-open:focus-visible {
  color: var(--accent-2);
  border-color: rgba(232, 135, 49, 0.42);
}

.profile-linked-note {
  margin: 0.1rem 0 0;
}

.npc-profile-shell {
  gap: 1rem;
}

.npc-profile-hero {
  grid-template-columns: auto minmax(0, 1fr);
}

.npc-profile-avatar {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 22px;
  font-size: 1.45rem;
  background:
    radial-gradient(circle at 30% 20%, rgba(248, 177, 94, 0.18), transparent 38%),
    linear-gradient(145deg, rgba(22, 31, 48, 0.96), rgba(8, 12, 21, 0.98));
  overflow: hidden;
}

.npc-profile-avatar-image {
  object-fit: contain;
  padding: 0.35rem;
}

.npc-profile-status-card {
  width: 100%;
  min-height: auto;
}

.npc-profile-quote {
  padding: 1rem 1.05rem;
  border-radius: 14px;
  border: 1px solid rgba(232, 135, 49, 0.26);
  background: rgba(232, 135, 49, 0.06);
  color: var(--text);
  font-weight: 800;
}

.npc-profile-grid,
.npc-profile-directory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
}

.npc-profile-card,
.npc-directory-card {
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
  padding: 0.85rem 0.9rem;
}

.npc-profile-card {
  display: grid;
  gap: 0.25rem;
}

.npc-profile-card span,
.npc-directory-card small {
  color: var(--muted);
}

.npc-profile-card strong,
.npc-directory-card strong {
  color: var(--text);
}

.npc-directory-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.npc-directory-card:hover,
.npc-directory-card:focus-visible,
.npc-directory-card.is-active {
  border-color: rgba(232, 135, 49, 0.32);
  background: rgba(232, 135, 49, 0.07);
}

.npc-directory-avatar-wrap,
.npc-directory-avatar {
  display: grid;
  place-items: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 12px;
  border: 1px solid rgba(232, 135, 49, 0.25);
  color: var(--text);
  font-weight: 900;
  background: rgba(8, 12, 21, 0.72);
  overflow: hidden;
}

.npc-directory-avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.18rem;
}

.profile-hero-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}

#moralityVoteActions {
  display: none !important;
}

.profile-hero-social-group {
  display: flex;
  justify-content: flex-end;
  position: relative;
}

.profile-action-menu {
  position: relative;
}

.profile-action-menu-trigger {
  min-width: 9.5rem;
}

.profile-action-menu-panel {
  position: absolute;
  top: calc(100% + 0.7rem);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 0.35rem;
  min-width: 15rem;
  padding: 0.7rem;
  border-radius: 18px;
  border: 1px solid rgba(240, 136, 49, 0.22);
  background: linear-gradient(180deg, rgba(15, 21, 34, 0.98), rgba(11, 15, 24, 0.98));
  box-shadow: 0 22px 45px rgba(0, 0, 0, 0.38);
}

.profile-action-menu-panel[hidden] {
  display: none;
}

.profile-action-menu-item {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.8rem 0.95rem;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.profile-action-menu-item:hover,
.profile-action-menu-item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(240, 136, 49, 0.4);
  background: rgba(240, 136, 49, 0.1);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.profile-action-menu-item[hidden] {
  display: none;
}

.profile-action-menu-item:disabled {
  cursor: default;
  opacity: 0.56;
  transform: none;
  box-shadow: none;
}

.profile-action-dialog {
  max-width: min(32rem, calc(100vw - 2rem));
}

.profile-action-picker-list {
  margin-top: -0.15rem;
  max-height: min(calc(4 * 4.65rem), 55vh);
  overflow-y: auto;
  padding-right: 0.3rem;
}

.profile-action-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  min-height: 4.65rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-action-picker-row:first-child {
  padding-top: 0;
}

.profile-action-picker-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.profile-action-picker-copy {
  display: grid;
  gap: 0.18rem;
}

.profile-action-picker-copy strong {
  font-size: 1rem;
}

.profile-action-picker-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.profile-hero-side .morality-vote-actions {
  justify-content: flex-end;
}

.profile-hero-side #profileActionStatus,
.profile-hero-side #alignmentVoteStatus {
  margin: 0;
  text-align: right;
  max-width: 22rem;
}

.profile-hero-morality-card {
  width: 100%;
  display: grid;
  gap: 0.45rem;
  padding: 0.2rem 0 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.profile-hero-morality-card .profile-hero-subpanel-head {
  justify-content: center;
  text-align: center;
  margin-bottom: 0.05rem;
}

.profile-hero-morality-card .profile-hero-subpanel-head h2 {
  margin-top: 0;
}

.profile-hero-morality-card .morality-summary {
  margin-top: 0;
  gap: 0.55rem;
}

.profile-hero-morality-card .morality-vote-breakdown {
  font-size: 0.98rem;
}

.profile-hero-morality-card .morality-visibility-actions {
  margin-top: 0.2rem;
  justify-content: center;
}

.profile-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.profile-card {
  min-height: 100%;
}

.profile-card-wide {
  grid-column: 1 / -1;
}

.profile-empty-state {
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.85rem 0.9rem;
}

.profile-empty-state p {
  margin: 0.2rem 0;
}

.profile-editor-summary {
  display: grid;
  gap: 0.7rem;
}

.profile-editor-summary-text {
  margin: 0;
  color: var(--text);
  line-height: 1.5;
}

.profile-comment-composer {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  margin-bottom: 0.85rem;
}

.profile-comment-composer-avatar,
.profile-comment-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  object-fit: cover;
}

.profile-comment-composer-avatar,
.profile-comment-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(232, 135, 49, 0.14), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(136, 180, 102, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.03);
}

.profile-comment-composer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.profile-comment-composer textarea {
  min-height: 2.45rem;
  max-height: 7rem;
  resize: vertical;
}

.profile-comment-list {
  display: grid;
  gap: 0.95rem;
}

.profile-comment-item {
  display: grid;
  grid-template-columns: minmax(12rem, 13.5rem) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.15rem 0;
}

.profile-comment-aside {
  min-width: 0;
}

.profile-comment-body {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  align-content: start;
}

.profile-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.7rem;
}

.profile-comment-body p {
  margin: 0;
  min-width: 0;
}

.profile-pagination-actions {
  justify-content: flex-start;
  align-items: center;
  margin-top: 0.9rem;
}

.profile-pagination-actions[hidden] {
  display: none !important;
}

.profile-stat-list {
  display: grid;
}

.profile-social-columns {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.profile-social-block {
  display: grid;
  gap: 0.5rem;
}

.profile-social-block h3 {
  margin: 0;
  font-size: 0.98rem;
}

.profile-social-list {
  display: grid;
  gap: 0.5rem;
}

.profile-social-item,
.profile-social-empty {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.7rem 0.8rem;
}

.profile-social-empty {
  color: var(--muted);
}

.profile-social-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
}

.profile-social-item-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem 0.58rem;
  align-items: baseline;
}

.profile-social-item p {
  margin: 0.25rem 0 0;
}

.profile-social-item-body {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.profile-social-item-head strong,
.profile-social-item-meta span,
.profile-social-badges {
  overflow-wrap: anywhere;
}

.profile-social-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.7rem;
  min-width: 0;
}

.notification-item.is-unread {
  border-color: rgba(136, 180, 102, 0.18);
  background: rgba(136, 180, 102, 0.05);
}

.profile-inline-actions {
  margin-top: 0.15rem;
  grid-column: 2;
  justify-content: flex-start;
}

.profile-social-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
  .profile-social-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-inline-actions {
    grid-column: auto;
  }
}

.group-picker-modal[hidden] {
  display: none !important;
}

.group-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 36;
}

.group-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 5, 0.72);
  backdrop-filter: blur(6px);
}

.group-picker-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100vw - 2rem));
  max-height: min(76vh, 680px);
  transform: translate(-50%, -50%);
  display: grid;
  gap: 0.85rem;
  overflow: hidden;
}

.group-create-dialog {
  width: min(640px, calc(100vw - 2rem));
}

.group-picker-list {
  min-height: 0;
  max-height: min(52vh, 440px);
  overflow: auto;
}

.group-picker-invite-btn.is-sent,
.group-picker-invite-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.groups-workspace {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.6fr) minmax(220px, 0.95fr);
  align-items: stretch;
  height: min(72vh, 760px);
  min-height: 0;
}

.groups-sidebar,
.groups-chat-column,
.groups-members-column {
  min-height: 0;
  border-radius: 1rem;
  border: 1px solid rgba(69, 99, 150, 0.22);
  background: rgba(7, 12, 22, 0.92);
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
  min-width: 0;
  align-content: start;
  overflow: hidden;
}

.groups-sidebar-header {
  align-items: center;
}

.groups-quick-create-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(76, 110, 163, 0.18);
  background: rgba(16, 24, 37, 0.88);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.groups-quick-create-btn:hover {
  border-color: rgba(232, 135, 49, 0.36);
  background: rgba(232, 135, 49, 0.08);
  transform: translateY(-1px);
}

.group-create-modal-actions {
  justify-content: flex-end;
}

.groups-sidebar-list,
.groups-members-list {
  display: grid;
  gap: 0.7rem;
  align-content: start;
  overflow: auto;
  min-height: 0;
  padding-top: 0.2rem;
  padding-right: 0.2rem;
}

.groups-sidebar,
.groups-members-column {
  grid-template-rows: auto minmax(0, 1fr);
}

.groups-sidebar-item {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 0.3rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(76, 110, 163, 0.18);
  background: rgba(14, 21, 34, 0.84);
  color: var(--text);
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.groups-sidebar-item:hover,
.groups-sidebar-item.is-active {
  border-color: rgba(232, 135, 49, 0.38);
  background: rgba(232, 135, 49, 0.09);
  transform: translateY(-1px);
}

.groups-sidebar-item-head,
.groups-member-item-head,
.groups-chat-message-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
}

.groups-chat-column {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

/* Owner renames the group by clicking the chat title (swaps to inline input). */
.group-title-editable {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.05rem 0.35rem;
  margin-left: -0.35rem;
  transition: background 140ms ease, color 140ms ease;
}

.group-title-editable:hover,
.group-title-editable:focus-visible {
  background: rgba(232, 135, 49, 0.12);
  outline: none;
}

.group-title-edit-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
  fill: currentColor;
  opacity: 0;
  color: var(--accent);
  transition: opacity 140ms ease;
}

.group-title-editable:hover .group-title-edit-icon,
.group-title-editable:focus-visible .group-title-edit-icon {
  opacity: 0.85;
}

.group-title-input {
  width: min(100%, 22rem);
  font: inherit;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  background: rgba(8, 13, 23, 0.95);
  border: 1px solid rgba(232, 135, 49, 0.55);
  border-radius: 9px;
  padding: 0.15rem 0.5rem;
}

.group-title-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 135, 49, 0.18);
}

/* Colour-coded action buttons so the safe and destructive actions never blur
   together: invite = flame (do), transfer = amber (caution), delete = red
   (danger), leave = red outline (exit). */
.group-action-stack .form-actions {
  display: flex;
}

.group-action-btn {
  width: 100%;
  font-weight: 600;
}

.group-action-invite {
  background: linear-gradient(135deg, var(--accent), #cc5b2d);
  color: var(--text);
}

.group-action-transfer {
  background: rgba(240, 196, 107, 0.12);
  border-color: rgba(240, 196, 107, 0.5);
  color: var(--warn);
}

.group-action-transfer:hover {
  background: rgba(240, 196, 107, 0.2);
  border-color: var(--warn);
}

.group-action-delete {
  background: linear-gradient(135deg, #c5413f, #8c2727);
  border-color: rgba(240, 130, 130, 0.55);
  color: #fff5f5;
}

.group-action-delete:hover {
  border-color: var(--bad);
}

.group-action-leave {
  background: rgba(240, 130, 130, 0.1);
  border-color: rgba(240, 130, 130, 0.45);
  color: #f3a6a6;
}

.group-action-leave:hover {
  background: rgba(240, 130, 130, 0.18);
  border-color: var(--bad);
}

.groups-chat-messages {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 0.8rem;
  padding-right: 0.2rem;
}

.groups-chat-message,
.groups-member-item {
  border-radius: 0.95rem;
  border: 1px solid rgba(76, 110, 163, 0.18);
  background: rgba(14, 21, 34, 0.86);
  padding: 0.85rem 0.95rem;
}

.groups-member-item.is-pending {
  border-color: rgba(232, 135, 49, 0.26);
  background: rgba(232, 135, 49, 0.06);
}

.groups-chat-message p,
.groups-member-item p {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.groups-chat-composer {
  display: grid;
  gap: 0.7rem;
}

.groups-chat-composer textarea {
  min-height: 5.5rem;
  max-height: 12rem;
  resize: vertical;
}

.clan-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.clan-tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(76, 110, 163, 0.18);
  background: rgba(16, 24, 37, 0.88);
  color: var(--text);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.clan-tab-button:hover,
.clan-tab-button.is-active {
  border-color: rgba(232, 135, 49, 0.38);
  background: rgba(232, 135, 49, 0.09);
  transform: translateY(-1px);
}

.clan-tab-panel {
  display: grid;
  gap: 1rem;
}

.clan-tab-panel .groups-workspace {
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.95fr);
}

.clan-settings-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}

.groups-members-column .clan-summary-card {
  gap: 0.6rem;
}

.groups-members-column #clanMembershipActions {
  margin-top: -0.15rem;
}

.clan-tab-panel .groups-members-column {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

@media (max-width: 1080px) {
  .groups-workspace {
    grid-template-columns: 1fr;
    height: auto;
  }

  .groups-sidebar,
  .groups-chat-column,
  .groups-members-column {
    min-height: 18rem;
  }
}

.profile-link-grid {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.95rem;
}

.profile-link-block {
  display: grid;
  gap: 0.75rem;
  place-items: center;
  padding: 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(76, 110, 163, 0.16);
  background: rgba(14, 21, 34, 0.84);
  text-align: center;
}

.profile-link-block h3 {
  margin: 0.3rem 0 0;
}

.profile-link-icon {
  width: 3.75rem;
  height: 3.75rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(76, 110, 163, 0.18);
  background: rgba(16, 24, 37, 0.9);
  color: #f3f5f2;
}

.profile-link-icon svg {
  width: 1.9rem;
  height: 1.9rem;
  fill: currentColor;
}

.profile-link-icon-image {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  display: block;
}

.profile-link-block .stack-form,
.profile-link-guest {
  width: 100%;
  display: grid;
  place-items: center;
}

.profile-link-block .stack-form[hidden],
.profile-link-guest[hidden] {
  display: none;
}

.profile-link-block .profile-empty-state {
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-link-actions-only {
  justify-content: center;
}

#discordLinkStatus:empty,
#steamLinkStatus:empty {
  display: none;
}

.morality-summary {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.morality-meter {
  position: relative;
}

.morality-meter-track {
  position: relative;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(90deg, rgba(96, 166, 100, 0.92) 0%, rgba(96, 166, 100, 0.92) 50%, rgba(186, 68, 52, 0.92) 50%, rgba(186, 68, 52, 0.92) 100%);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.morality-meter-track.is-neutral {
  background: linear-gradient(90deg, rgba(104, 104, 104, 0.9), rgba(130, 130, 130, 0.96));
}

.morality-meter-indicator {
  position: absolute;
  top: 50%;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  background: #101312;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
  transform: translateY(-50%);
}

.morality-vote-breakdown {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.88rem;
}

.morality-visibility-actions {
  margin-top: 0.9rem;
  align-items: center;
}

.morality-panel-vote-actions[hidden] {
  display: none !important;
}

.clan-summary-card {
  display: grid;
  gap: 0.75rem;
}

.elastic-scroll-surface {
  overscroll-behavior: contain;
}

.elastic-scroll-content {
  display: inherit;
  flex-direction: inherit;
  flex-wrap: inherit;
  align-items: inherit;
  align-content: inherit;
  justify-content: inherit;
  justify-items: inherit;
  gap: inherit;
  row-gap: inherit;
  column-gap: inherit;
  grid-template-columns: inherit;
  grid-template-rows: inherit;
  grid-auto-columns: inherit;
  grid-auto-rows: inherit;
  grid-auto-flow: inherit;
  width: 100%;
  transform: translate3d(0, var(--elastic-shift-y, 0px), 0);
  will-change: transform;
  transition: transform 180ms cubic-bezier(0.22, 0.8, 0.24, 1);
}

.elastic-scroll-surface.is-elastic-dragging .elastic-scroll-content {
  transition: none;
}

.clan-switcher-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.clan-switcher-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.84rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.clan-switcher-chip:hover {
  border-color: rgba(232, 135, 49, 0.28);
  background: rgba(232, 135, 49, 0.08);
  transform: translateY(-1px);
}

.clan-switcher-chip span {
  color: var(--muted);
  font-size: 0.76rem;
}

.clan-switcher-chip.is-active {
  border-color: rgba(136, 180, 102, 0.28);
  background: rgba(136, 180, 102, 0.1);
}

.clan-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.clan-tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(136, 180, 102, 0.14);
  border: 1px solid rgba(136, 180, 102, 0.28);
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  appearance: none;
  cursor: default;
}

.clan-info-title-wrap {
  margin: 0 0 0.9rem;
}

.clan-info-name-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: left;
  cursor: default;
}

.clan-info-name-button.is-editable,
.clan-tag-badge.is-editable,
.clan-description-display.is-editable {
  cursor: pointer;
}

.clan-info-name-button:disabled,
.clan-tag-badge:disabled,
.clan-description-display:disabled {
  opacity: 1;
  pointer-events: none;
}

.clan-info-name-button.is-editable:hover,
.clan-tag-badge.is-editable:hover,
.clan-description-display.is-editable:hover {
  filter: brightness(1.08);
}

.clan-description-display {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font: inherit;
}

.clan-profile-dialog {
  width: min(100%, 36rem);
}

.clan-summary-meta,
.clan-summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.clan-summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.2rem;
}

.clan-summary-meta span {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.clan-stat-card {
  position: relative;
  display: grid;
  gap: 0.22rem;
  min-height: 4.7rem;
  padding: 0.82rem 0.9rem;
  overflow: hidden;
  border-radius: 0.85rem;
  border: 1px solid rgba(232, 135, 49, 0.18);
  background:
    radial-gradient(circle at 86% 12%, rgba(232, 135, 49, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 12px 28px rgba(0, 0, 0, 0.18);
}

.clan-stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(255, 167, 77, 0.95), rgba(210, 94, 38, 0.85));
  opacity: 0.86;
}

.clan-stat-card.is-primary {
  border-color: rgba(255, 167, 77, 0.35);
  background:
    radial-gradient(circle at 82% 8%, rgba(255, 167, 77, 0.28), transparent 38%),
    linear-gradient(145deg, rgba(232, 135, 49, 0.13), rgba(255, 255, 255, 0.035));
}

.clan-stat-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.clan-stat-value {
  color: var(--text);
  font-size: clamp(1rem, 1.8vw, 1.32rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  .elastic-scroll-content,
  .elastic-scroll-surface.is-elastic-active .elastic-scroll-content {
    transform: none !important;
    transition: none !important;
  }
}

.clan-public-grid {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
}

.clan-public-hero,
.clan-public-roster {
  display: grid;
  gap: 0.9rem;
}

.clan-public-brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.clan-public-logo {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

.clan-public-logo-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(232, 135, 49, 0.16), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(136, 180, 102, 0.13), transparent 55%),
    rgba(255, 255, 255, 0.03);
}

.clan-public-brand-copy {
  display: grid;
  gap: 0.55rem;
}

.clan-public-brand-copy h3 {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
}

.profile-message-thread {
  margin-top: 0.85rem;
  min-height: 180px;
  max-height: 360px;
  overflow: auto;
  display: grid;
  gap: 0.55rem;
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(8, 10, 9, 0.4);
}

.messages-shell {
  width: min(var(--page-max-width), calc(100% - 1.5rem));
  margin: 0.9rem auto 2rem;
  display: grid;
  gap: 0.95rem;
}

.messages-hero h1 {
  margin-top: 0.3rem;
}

.messages-layout {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
}

.messages-sidebar,
.messages-thread-panel {
  min-height: 100%;
}

.messages-groups {
  display: grid;
  gap: 0.9rem;
}

.messages-group {
  display: grid;
  gap: 0.5rem;
}

.messages-group h3 {
  margin: 0;
  font-size: 0.98rem;
}

.friends-search-form {
  margin-bottom: 0.95rem;
}

.community-shell {
  width: min(var(--page-max-width), calc(100% - 1.5rem));
  margin: 0.9rem auto 2rem;
  display: grid;
  gap: 0.95rem;
}

.community-summary-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.community-summary-card {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.community-summary-card span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.community-summary-card strong {
  font-size: 1.5rem;
}

.community-friends-list {
  display: grid;
  gap: 0.75rem;
}

.community-friend-card {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.community-friend-avatar,
.community-friend-avatar-fallback {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 14px;
}

.community-friend-avatar {
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.community-friend-avatar-fallback {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(232, 135, 49, 0.24), rgba(136, 180, 102, 0.24));
  color: var(--text);
  font-weight: 700;
}

.community-friend-copy {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.community-friend-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.community-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.community-status-badge::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--muted);
}

.community-status-badge.is-online {
  color: var(--good);
  border-color: rgba(159, 220, 129, 0.28);
  background: rgba(159, 220, 129, 0.08);
}

.community-status-badge.is-online::before {
  background: var(--good);
}

.community-status-badge.is-offline {
  color: var(--muted);
}

.community-friend-meta {
  display: grid;
  gap: 0.18rem;
}

.community-friend-meta p {
  margin: 0;
}

.community-friend-actions {
  justify-content: flex-end;
}

.community-empty {
  padding: 1rem;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--muted);
}

.user-search-result-row {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.user-search-result-copy {
  min-width: 0;
  flex: 1;
}

.user-search-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

.user-search-avatar-fallback {
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(232, 135, 49, 0.14), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(136, 180, 102, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.03);
}

.user-search-name {
  color: var(--text);
}

.identity-inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.3rem;
}

.identity-inline-main {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
}

.identity-inline-stacked {
  display: inline-grid;
  justify-items: start;
  gap: 0.18rem;
}

.identity-inline-name {
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-decoration: none;
}

a.identity-inline-name:hover,
a.identity-inline-name:focus-visible {
  color: rgba(255, 198, 121, 0.98);
}

/* Generic account-name link: inherits the surrounding type, adds link
   affordance. Used wherever a member/account name should open their profile. */
a.account-name-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a.account-name-link:hover,
a.account-name-link:focus-visible {
  color: var(--accent-2);
  text-decoration: underline;
}

.identity-inline-avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.62rem;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(232, 135, 49, 0.34);
  background:
    radial-gradient(circle at 20% 20%, rgba(232, 135, 49, 0.14), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(136, 180, 102, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.03);
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.identity-inline-avatar-fallback {
  display: inline-grid;
  place-items: center;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
}

.identity-card {
  display: grid;
  grid-template-columns: 3.85rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  min-width: 0;
}

.identity-card-avatar {
  width: 3.85rem;
  height: 3.85rem;
  border-radius: 0.9rem;
  object-fit: cover;
  border: 1px solid rgba(232, 135, 49, 0.34);
  background:
    radial-gradient(circle at 20% 20%, rgba(232, 135, 49, 0.14), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(136, 180, 102, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.03);
  box-shadow:
    0 14px 26px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.04);
}

.identity-card-avatar-tongs {
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.identity-card-avatar-image-tongs {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateY(-2%) scale(1.12);
  transform-origin: center;
}

.identity-card-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
}

.identity-card-copy {
  display: grid;
  gap: 0.18rem;
  align-content: start;
  min-width: 0;
  padding-top: 0.08rem;
}

.identity-card-name {
  color: var(--text);
  display: inline-block;
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-decoration: none;
}

a.identity-card-name:hover,
a.identity-card-name:focus-visible {
  color: rgba(255, 198, 121, 0.98);
}

.identity-card-title-row,
.identity-card-morality-row {
  display: flex;
  align-items: center;
  min-height: 1.15rem;
}

.identity-card-morality-row .morality-label {
  font-size: 0.76rem;
  font-weight: 700;
}

.morality-label {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: capitalize;
  line-height: 1.15;
}

.morality-label.is-hero {
  color: rgb(96, 166, 100);
}

.morality-label.is-bandit {
  color: rgb(186, 68, 52);
}

.morality-label.is-neutral {
  color: var(--muted);
}

.user-search-morality {
  font-weight: 600;
  text-transform: capitalize;
}

.user-search-morality.is-hero {
  color: rgb(96, 166, 100);
}

.user-search-morality.is-bandit {
  color: rgb(186, 68, 52);
}

.user-search-morality.is-neutral {
  color: var(--muted);
}

.message-widget-launcher {
  position: fixed;
  inset: auto 1rem 1rem auto;
  left: auto;
  top: auto;
  right: 1rem;
  bottom: 1rem;
  margin: 0;
  z-index: 24;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-width: 220px;
  padding: 0.75rem 1rem;
  border-width: 1px;
  border-style: solid;
  border-radius: 999px;
  color: var(--text);
  border-color: rgba(69, 99, 150, 0.22);
  background:
    radial-gradient(circle at 14% 18%, rgba(53, 93, 156, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(7, 12, 22, 0.98), rgba(5, 9, 18, 0.98));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4);
}

.message-widget-launcher[hidden] {
  display: none !important;
}

.message-widget-launcher-copy {
  display: grid;
  gap: 0.1rem;
  text-align: left;
}

.message-widget-launcher-title {
  font-weight: 700;
}

.message-widget-launcher-meta {
  font-size: 0.72rem;
  color: rgba(173, 189, 214, 0.84);
}

.message-widget-launcher-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(232, 135, 49, 0.92);
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1;
}

.message-widget {
  position: fixed;
  inset: auto 1rem 5.75rem auto;
  left: auto;
  top: auto;
  right: 1rem;
  bottom: 5.75rem;
  margin: 0;
  z-index: 24;
  width: min(880px, calc(100vw - 2rem));
  /* BM-291: fixed height so the panel is the same size on every tab/conversation
     (the friends tab no longer shrinks below the social tab). Inner thread/list
     scroll once their content exceeds this. */
  height: min(82vh, 720px);
  max-height: min(82vh, 720px);
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(53, 93, 156, 0.14), transparent 28%),
    radial-gradient(circle at 92% 14%, rgba(232, 135, 49, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(7, 12, 22, 0.99), rgba(5, 9, 18, 0.99));
  border-color: rgba(69, 99, 150, 0.22);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate3d(40px, 10px, 0) scale(0.97);
  transform-origin: bottom right;
  will-change: transform, opacity;
}

.message-widget[hidden] {
  display: none !important;
}

.message-widget.is-open {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  animation: message-widget-grow 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.message-widget.is-closing {
  opacity: 1;
  transform: translate3d(40px, 10px, 0) scale(0.97);
  animation: message-widget-shrink 220ms cubic-bezier(0.2, 0.8, 0.2, 1) 110ms both;
}

@keyframes message-widget-grow {
  0% {
    opacity: 0;
    transform: translate3d(40px, 10px, 0) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes message-widget-shrink {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(40px, 10px, 0) scale(0.97);
  }
}

.message-widget-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(69, 99, 150, 0.16);
}

.message-widget-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.message-widget-body {
  display: grid;
  /* 60/40 split: chat thread on the left (60), friends/social list on the right (40). */
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 0.9rem;
  min-height: 0;
  overflow: hidden;
}

.message-widget-counter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.message-widget-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(76, 110, 163, 0.16);
  background: rgba(16, 24, 37, 0.88);
  font-size: 0.78rem;
}

.message-widget-stat-stack {
  display: grid;
  gap: 0.15rem;
}

.message-widget-toolbar {
  display: flex;
  gap: 0.55rem;
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
}

.message-widget-body-reference {
  align-items: stretch;
  min-height: 0;
  height: 100%;
}

.message-widget-chat-card,
.message-widget-friend-card {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  padding: 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(74, 104, 156, 0.18);
  background:
    radial-gradient(circle at 14% 12%, rgba(52, 87, 140, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(9, 15, 27, 0.94), rgba(10, 16, 28, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  overflow: hidden;
  opacity: 0;
  will-change: transform, opacity;
}

.message-widget-chat-card {
  position: relative;
  z-index: 1;
  transform: translate3d(64px, 0, 0) scaleX(0.68) scaleY(0.98);
  transform-origin: right center;
}

/* BM-290: the conversation thread fills the column and the compose row sits at
   the bottom (in line with the friends-list actions). Status + compose are
   grouped so the thread (1fr) is the only flexible row. */
.message-widget-chat-card {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.message-widget-chat-foot {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

#messageWidgetStatus {
  margin: 0;
}

.message-widget-friend-card {
  position: relative;
  z-index: 2;
  transform: translate3d(40px, 0, 0) scale(0.985);
  transform-origin: right center;
}

.message-widget.is-open .message-widget-friend-card {
  animation: message-widget-pane-right-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.message-widget.is-open .message-widget-chat-card {
  animation: message-widget-pane-left-in 300ms cubic-bezier(0.2, 0.8, 0.2, 1) 60ms both;
}

.message-widget.is-closing .message-widget-friend-card {
  animation: message-widget-pane-right-out 220ms cubic-bezier(0.2, 0.8, 0.2, 1) 60ms both;
}

.message-widget.is-closing .message-widget-chat-card {
  animation: message-widget-pane-left-out 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes message-widget-pane-right-in {
  0% {
    opacity: 0;
    transform: translate3d(40px, 0, 0) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes message-widget-pane-left-in {
  0% {
    opacity: 0;
    transform: translate3d(64px, 0, 0) scaleX(0.68) scaleY(0.98);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scaleX(1) scaleY(1);
  }
}

@keyframes message-widget-pane-right-out {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(40px, 0, 0) scale(0.985);
  }
}

@keyframes message-widget-pane-left-out {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scaleX(1) scaleY(1);
  }
  100% {
    opacity: 0;
    transform: translate3d(64px, 0, 0) scaleX(0.68) scaleY(0.98);
  }
}

.message-widget-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

/* BM-281: segmented Friends/Social control */
.message-widget-chat-tabs {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.22rem;
  border-radius: 13px;
  background: rgba(8, 13, 22, 0.62);
  border: 1px solid rgba(69, 99, 150, 0.18);
  box-shadow: inset 0 1px 2px rgba(3, 6, 12, 0.4);
}

.message-widget-chat-tab {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  padding: 0.36rem 0.92rem;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.message-widget-chat-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.message-widget-chat-tab.is-active {
  border-color: rgba(232, 135, 49, 0.36);
  background: linear-gradient(180deg, rgba(232, 135, 49, 0.22), rgba(224, 125, 39, 0.1));
  color: #fff5ec;
  box-shadow: 0 2px 9px rgba(224, 125, 39, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* BM-283: refined action pills (+ Add / Requests / Blocks), now in the panel footer */
.message-widget-panel-actions {
  padding-top: 0.15rem;
}

.message-widget-friend-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.message-widget-friend-actions[hidden] {
  display: none;
}

.message-widget-friend-actions .btn {
  width: 100%;
  text-align: center;
  border-radius: 999px;
  padding: 0.5rem 0.6rem;
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid rgba(108, 140, 196, 0.2);
  background: linear-gradient(180deg, rgba(21, 30, 48, 0.92), rgba(13, 20, 34, 0.86));
  color: rgba(206, 217, 238, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.message-widget-friend-actions .btn:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 156, 212, 0.36);
  background: linear-gradient(180deg, rgba(28, 39, 62, 0.96), rgba(17, 25, 42, 0.9));
  color: var(--text);
}

.message-widget-friend-actions .btn:active {
  transform: translateY(0);
}

/* + Add: subtle flame accent so the primary action stands out */
#messageWidgetAddBtn {
  color: #f0b27a;
  border-color: rgba(232, 135, 49, 0.34);
  background: linear-gradient(180deg, rgba(62, 42, 22, 0.6), rgba(40, 28, 16, 0.52));
}

#messageWidgetAddBtn:hover {
  color: #ffce9b;
  border-color: rgba(232, 135, 49, 0.5);
  background: linear-gradient(180deg, rgba(78, 52, 27, 0.74), rgba(50, 34, 18, 0.64));
}

/* Active toggle state (Requests / Blocks) */
.message-widget-friend-actions .btn.btn-primary {
  color: #fff7ef;
  border-color: rgba(232, 135, 49, 0.55);
  background: linear-gradient(180deg, #ef9a45, #df7c26);
  box-shadow: 0 6px 16px rgba(224, 125, 39, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.message-widget-friend-actions .btn.btn-primary:hover {
  color: #fff;
  background: linear-gradient(180deg, #f3a956, #e8842d);
}

/* BM-282: Create a Group / Create a Clan actions at the foot of the social panel */
.message-widget-social-create {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding-top: 0.15rem;
}

/* The display:grid above outranks the [hidden] UA rule, so hide explicitly. */
.message-widget-social-create[hidden] {
  display: none;
}

.message-widget-social-create .btn {
  width: 100%;
  text-align: center;
  border-radius: 12px;
  padding: 0.52rem 0.6rem;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid rgba(232, 135, 49, 0.3);
  background: linear-gradient(180deg, rgba(58, 40, 21, 0.5), rgba(34, 24, 14, 0.46));
  color: #f0b27a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1), border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.message-widget-social-create .btn:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 135, 49, 0.55);
  background: linear-gradient(180deg, rgba(80, 53, 27, 0.72), rgba(48, 33, 18, 0.62));
  color: #ffce9b;
  box-shadow: 0 6px 16px rgba(224, 125, 39, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.message-widget-social-create .btn:active {
  transform: translateY(0);
}

.message-widget-friend-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.message-widget-friend-head input,
.message-widget-compose-row input {
  width: 100%;
  border-radius: 12px;
  background: rgba(8, 13, 22, 0.72);
  border: 1px solid rgba(69, 99, 150, 0.18);
}

.message-widget-friend-head input {
  max-width: 175px;
}

/* BM-285: friend/online tracker now lives at the top of the list panel,
   left of the search field. */
.message-widget-friend-head-stats {
  gap: 0.04rem;
  min-width: 0;
}

.message-widget-friend-head-stats strong {
  font-size: 0.8rem;
  line-height: 1.22;
  white-space: nowrap;
}

.message-widget-friend-list {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  grid-auto-rows: max-content;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  padding-right: 0.2rem;
}

.message-widget-reference-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding: 0.48rem 0.58rem;
  align-self: start;
  border-radius: 14px;
  border: 1px solid rgba(69, 99, 150, 0.16);
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.9), rgba(13, 19, 32, 0.8));
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.message-widget-reference-row.is-active {
  border-color: rgba(232, 135, 49, 0.32);
  background:
    radial-gradient(circle at 12% 18%, rgba(232, 135, 49, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(50, 35, 18, 0.72), rgba(35, 24, 14, 0.6));
  box-shadow: inset 0 0 0 1px rgba(232, 135, 49, 0.08);
}

.message-widget-reference-row:hover {
  border-color: rgba(92, 122, 176, 0.28);
  background: linear-gradient(180deg, rgba(21, 30, 48, 0.92), rgba(15, 23, 37, 0.84));
}

.message-widget-reference-copy {
  display: grid;
  gap: 0.06rem;
  cursor: pointer;
  min-width: 0;
}

.message-widget-reference-title-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.message-widget-presence-dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(7, 12, 10, 0.92);
}

.message-widget-presence-dot.is-online {
  background: #e88731;
}

.message-widget-presence-dot.is-offline {
  background: #7183a5;
}

.message-widget-unread-badge {
  position: static;
  top: auto;
  right: auto;
  margin-left: auto;
  min-width: 1.05rem;
  height: 1.05rem;
  box-shadow: none;
  flex: 0 0 auto;
}

.message-widget-reference-actions {
  display: grid;
  gap: 0.25rem;
  align-content: start;
  min-width: 86px;
}

.message-widget-reference-actions .btn {
  padding: 0.36rem 0.62rem;
  min-height: 0;
  line-height: 1.1;
}

.message-widget-reference-copy strong {
  line-height: 1.15;
}

.message-widget-reference-copy .small {
  line-height: 1.1;
}

/* BM-275: enriched friends / social rows (avatars, clan tags, titles, notes) */
.message-widget-friend-main,
.message-widget-social-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.message-widget-friend-identity,
.message-widget-social-identity {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.message-widget-friend-entry .message-widget-reference-title-row,
.message-widget-social-entry .message-widget-reference-title-row {
  min-width: 0;
}

.message-widget-friend-entry .message-widget-reference-title-row > strong,
.message-widget-social-entry .message-widget-reference-title-row > strong {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-widget-friend-entry .message-widget-presence-dot {
  margin-left: 0.05rem;
}

.message-widget-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 11px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, rgba(58, 80, 122, 0.55), rgba(28, 39, 60, 0.7));
  border: 1px solid rgba(108, 140, 196, 0.24);
  box-shadow: inset 0 0 0 1px rgba(8, 13, 22, 0.4);
}

.message-widget-avatar-fallback {
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(220, 230, 248, 0.9);
  letter-spacing: 0.01em;
}

.message-widget-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-widget-clan-tag {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f0b27a;
  background: rgba(232, 135, 49, 0.12);
  border: 1px solid rgba(232, 135, 49, 0.28);
  border-radius: 6px;
  padding: 0.04rem 0.32rem;
  line-height: 1.35;
  white-space: nowrap;
}

.message-widget-friend-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.message-widget-title-chip {
  --title-accent: #8fb0e6;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--title-accent);
  background: color-mix(in srgb, var(--title-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--title-accent) 38%, transparent);
  border-radius: 999px;
  padding: 0.05rem 0.46rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-widget-note-icon {
  position: relative;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  color: #e7b06a;
  cursor: help;
  outline: none;
}

.message-widget-note-icon svg {
  width: 0.92rem;
  height: 0.92rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-widget-note-icon::after {
  content: attr(data-note);
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%) translateY(0.2rem);
  z-index: 40;
  min-width: 7rem;
  max-width: 15rem;
  width: max-content;
  padding: 0.4rem 0.55rem;
  border-radius: 9px;
  background: rgba(10, 15, 25, 0.97);
  border: 1px solid rgba(231, 176, 106, 0.32);
  color: rgba(229, 236, 248, 0.94);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 12px 28px rgba(3, 6, 12, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.message-widget-note-icon:hover::after,
.message-widget-note-icon:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.message-widget-social-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 11px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(108, 140, 196, 0.22);
}

.message-widget-social-avatar svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.message-widget-social-avatar-relay {
  color: #7fc8a9;
  background: linear-gradient(150deg, rgba(46, 96, 76, 0.5), rgba(22, 42, 36, 0.7));
}

.message-widget-social-avatar-clan {
  color: #f0b27a;
  background: linear-gradient(150deg, rgba(94, 62, 28, 0.5), rgba(40, 28, 16, 0.7));
}

.message-widget-social-avatar-group {
  color: #93b2ec;
  background: linear-gradient(150deg, rgba(48, 70, 116, 0.5), rgba(24, 36, 60, 0.7));
}

.message-widget-social-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-widget-social-type {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 6px;
  padding: 0.05rem 0.34rem;
  line-height: 1.4;
}

.message-widget-social-type-relay {
  color: #7fc8a9;
  background: rgba(70, 150, 116, 0.14);
  border: 1px solid rgba(70, 150, 116, 0.3);
}

.message-widget-social-type-clan {
  color: #f0b27a;
  background: rgba(232, 135, 49, 0.13);
  border: 1px solid rgba(232, 135, 49, 0.3);
}

.message-widget-social-type-group {
  color: #93b2ec;
  background: rgba(82, 116, 188, 0.15);
  border: 1px solid rgba(82, 116, 188, 0.32);
}

.message-widget-social-meta {
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.message-widget-social-preview {
  font-size: 0.74rem;
  line-height: 1.25;
  color: rgba(176, 190, 214, 0.72);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.message-widget-compose-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 0.45rem;
  align-items: center;
  padding-top: 0.1rem;
}

.message-widget-attachment-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem;
  border: 1px solid rgba(232, 135, 49, 0.22);
  border-radius: 14px;
  background:
    radial-gradient(circle at 8% 18%, rgba(232, 135, 49, 0.1), transparent 36%),
    rgba(9, 15, 25, 0.92);
}

.message-widget-attachment-preview[hidden] {
  display: none !important;
}

.message-widget-attachment-thumb {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}

.message-widget-attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.message-widget-attachment-copy {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.message-widget-attachment-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-widget-message-attachments {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.45rem;
  min-width: 0;
}

.message-widget-message-attachment {
  display: block;
  width: fit-content;
  min-width: 0;
  /* Cap the card to the message width AND 15rem so the picture never spills
     past its bubble (the % resolves against the now-shrinkable grid chain). */
  max-width: min(100%, 15rem);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(232, 135, 49, 0.2);
  background: rgba(0, 0, 0, 0.25);
}

.message-widget-message-attachment img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 13rem;
  object-fit: contain;
}

.message-widget-emoji-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.15rem, 1fr));
  gap: 0.35rem;
  max-height: 10.75rem;
  overflow: auto;
  padding: 0.58rem;
  border-radius: 14px;
  border: 1px solid rgba(69, 99, 150, 0.18);
  background:
    radial-gradient(circle at 12% 10%, rgba(232, 135, 49, 0.08), transparent 34%),
    rgba(8, 13, 22, 0.94);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

.message-widget-emoji-picker[hidden] {
  display: none !important;
}

.message-widget-emoji-option {
  appearance: none;
  display: grid;
  place-items: center;
  min-width: 0;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.message-widget-emoji-option:hover,
.message-widget-emoji-option:focus-visible {
  border-color: rgba(232, 135, 49, 0.34);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}

.message-widget-emoji-option img,
.message-widget-custom-emoji {
  width: 1.45rem;
  height: 1.45rem;
  object-fit: contain;
  vertical-align: -0.28rem;
}

.message-widget-emoji-option-native span {
  font-size: 1.32rem;
  line-height: 1;
}

.message-widget-emoji-section-title {
  grid-column: 1 / -1;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-widget-emoji-empty {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.message-widget-thread {
  min-height: 0;
  min-width: 0;
  max-height: none;
  height: 100%;
  overflow: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.22rem;
  align-content: start;
  grid-auto-rows: max-content;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(69, 99, 150, 0.16);
  background:
    radial-gradient(circle at 14% 10%, rgba(52, 87, 140, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(6, 10, 18, 0.78), rgba(8, 12, 20, 0.68));
}

.message-widget .stack-form {
  margin-top: 0;
}

.message-widget-status {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .clan-public-grid {
    grid-template-columns: 1fr;
  }

  .clan-public-brand {
    flex-direction: column;
  }

  .message-widget {
    width: min(96vw, 680px);
    height: min(90vh, 860px);
    max-height: min(90vh, 860px);
  }

  .message-widget-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .message-widget-friend-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .message-widget-reference-row {
    grid-template-columns: 1fr;
  }

  .message-widget-reference-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .message-widget-compose-row {
    grid-template-columns: 1fr 1fr;
  }
}

.forum-shell {
  width: min(var(--page-max-width), calc(100% - 1.5rem));
  margin: 0.9rem auto 2rem;
  display: grid;
  gap: 0.95rem;
}

.forum-hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.forum-hero-actions {
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.forum-hero h1 {
  margin-top: 0.25rem;
}

.forum-grid {
  display: grid;
  gap: 0.95rem;
  grid-template-columns: 1fr;
}

.forum-posts-wrap {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  padding: 1rem;
}

.forum-browse-controls {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: minmax(0, 1.7fr) minmax(180px, 0.7fr) auto;
  align-items: start;
  margin-bottom: 0.8rem;
}

.forum-feed-tabs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.forum-feed-tab {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.2;
  padding: 0.48rem 0.78rem;
}

.forum-feed-tab:hover,
.forum-feed-tab:focus-visible {
  border-color: rgba(255, 179, 108, 0.45);
  outline: none;
}

.forum-feed-tab.is-active {
  border-color: rgba(255, 179, 108, 0.72);
  background: rgba(232, 135, 49, 0.16);
}

.forum-visibility-fieldset {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
}

.forum-visibility-fieldset legend {
  padding: 0 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.forum-visibility-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.forum-visibility-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 0.22rem 0.52rem;
}

.forum-search-control {
  display: grid;
  gap: 0.4rem;
}

.forum-search-help {
  margin: 0;
  line-height: 1.35;
}

.forum-browse-controls .form-actions {
  align-items: center;
  align-self: start;
  justify-content: flex-start;
  flex-wrap: nowrap;
  margin-top: 1.95rem;
}

.forum-post-list {
  display: grid;
  gap: 0.7rem;
}

.forum-post-item {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.8rem;
  display: grid;
  gap: 0.45rem;
}

.forum-post-item.forum-post-open {
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.forum-post-item.forum-post-open:hover,
.forum-post-item.forum-post-open:focus-visible {
  border-color: rgba(232, 135, 49, 0.32);
  background: rgba(255, 255, 255, 0.035);
  transform: translateY(-1px);
  outline: none;
}

.forum-post-item h3 {
  font-size: 1.3rem;
  line-height: 1.3;
}

.forum-post-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.forum-post-pin-badge {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 135, 49, 0.34);
  background: rgba(232, 135, 49, 0.12);
  color: #ffd8b5;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.forum-post-item .muted.small {
  font-size: 1.04rem;
}

.forum-post-item-active {
  border-color: rgba(232, 135, 49, 0.38);
  box-shadow: inset 0 0 0 1px rgba(232, 135, 49, 0.18);
}

.forum-post-item h3 {
  margin: 0;
}

.forum-post-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.forum-vote-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.forum-vote-btn-active {
  border-color: rgba(136, 180, 102, 0.65);
  background: rgba(136, 180, 102, 0.12);
}

.forum-vote-arrow-btn {
  min-width: 2.6rem;
  padding-inline: 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.forum-author-actions {
  margin-top: 0.55rem;
  justify-content: flex-start;
}

.forum-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.forum-tag-chip {
  appearance: none;
  border: 1px solid rgba(136, 180, 102, 0.28);
  background: rgba(136, 180, 102, 0.08);
  color: var(--text);
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.forum-detail-wrap {
  display: grid;
  gap: 0.7rem;
}

.forum-thread-shell {
  gap: 0.95rem;
}

.forum-detail-wrap .forum-hero-head {
  margin-bottom: 0.15rem;
}

.forum-detail-body {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.85rem;
}

.forum-thread-main {
  display: grid;
  gap: 0.5rem;
}

.forum-entry-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 13.75rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.forum-entry-layout-compact {
  gap: 0.85rem;
}

.forum-entry-aside,
.forum-entry-body {
  min-width: 0;
}

.forum-entry-body {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.forum-entry-meta-copy {
  margin: 0;
}

.forum-thread-content {
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.forum-post-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.forum-post-attachments.is-compact {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.forum-post-attachment-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.forum-post-attachment-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.forum-attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.forum-attachment-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(136, 180, 102, 0.24);
  background: rgba(136, 180, 102, 0.08);
  color: var(--text);
  font-size: 0.82rem;
}

.forum-comments-wrap {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.55rem;
}

.forum-comments-panel {
  display: grid;
  gap: 0.8rem;
}

.forum-comments-list {
  display: grid;
  gap: 0.55rem;
}

.forum-comment-item {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.018)),
    rgba(255, 255, 255, 0.02);
  padding: 0.78rem 0.9rem;
}

.forum-comment-item-hidden {
  border-color: rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.01);
  opacity: 0.58;
}

.forum-comment-item-hidden .muted,
.forum-comment-item-hidden p,
.forum-comment-item-hidden a {
  color: rgba(239, 244, 236, 0.58);
}

.forum-comment-item p {
  margin: 0.28rem 0;
}

@media (max-width: 820px) {
  .profile-comment-item,
  .forum-entry-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.forum-mod-panel {
  margin-top: 0.75rem;
  border-radius: 12px;
  border: 1px dashed rgba(232, 135, 49, 0.35);
  background: rgba(232, 135, 49, 0.06);
  padding: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.forum-create-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.forum-create-modal[hidden] {
  display: none !important;
}

.forum-create-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 6, 0.72);
  backdrop-filter: blur(8px);
}

.forum-create-modal-panel {
  position: relative;
  width: min(860px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  display: grid;
  gap: 0.85rem;
}

.profile-edit-dialog {
  width: min(42rem, calc(100vw - 2rem));
}

.forum-create-modal-head {
  align-items: flex-start;
}

.forum-create-guidance {
  margin: 0.2rem 0 0;
}

body.modal-open {
  overflow: hidden;
}

.forum-mod-queue {
  display: grid;
  gap: 0.6rem;
}

.forum-mod-queue-list {
  display: grid;
  gap: 0.55rem;
}

.forum-mod-queue-item {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(8, 10, 9, 0.36);
}

.forum-mod-queue-head {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.forum-mod-log-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: end;
}

.forum-create-inline-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.forum-mod-log-controls select {
  min-width: 140px;
}

.forum-mod-log-controls input {
  min-width: 180px;
}

.forum-mod-log-controls select,
.forum-mod-log-controls input {
  width: 100%;
}

.forum-mod-log-list {
  display: grid;
  gap: 0.45rem;
}

#forumModLogMeta {
  margin: 0.65rem 0 0;
}

.forum-mod-log-item {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.12);
  padding: 0.55rem 0.65rem;
}

.forum-mod-log-item p {
  margin: 0.2rem 0;
}

/* Shared crop modal styles. Used by the clan avatar editor (my-clans.html).
   The user profile avatar no longer uses this; profile pictures are derived
   from the linked Discord/Steam account. */
.avatar-crop-modal[hidden] {
  display: none !important;
}

.avatar-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.avatar-crop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
}

.avatar-crop-dialog {
  position: relative;
  z-index: 1;
  width: min(540px, calc(100vw - 2rem));
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 15, 14, 0.95);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
  padding: 1rem;
}

.avatar-crop-stage {
  position: relative;
  margin-top: 0.75rem;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(255,255,255,0.02) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.02) 75%),
    linear-gradient(45deg, rgba(255,255,255,0.02) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.02) 75%),
    rgba(255, 255, 255, 0.02);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px, 0 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  cursor: grab;
  touch-action: none;
}

.avatar-crop-stage.is-dragging {
  cursor: grabbing;
}

.avatar-crop-image {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  user-select: none;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform;
}

.avatar-crop-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.14),
    inset 0 0 0 9999px rgba(0, 0, 0, 0.18);
}

.avatar-crop-frame::before,
.avatar-crop-frame::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
}

.avatar-crop-frame::before {
  left: 33.333%;
  top: 0;
  width: 1px;
  height: 100%;
  box-shadow: calc(33.333% + 1px) 0 0 rgba(255, 255, 255, 0.12);
}

.avatar-crop-frame::after {
  top: 33.333%;
  left: 0;
  width: 100%;
  height: 1px;
  box-shadow: 0 calc(33.333% + 1px) 0 rgba(255, 255, 255, 0.12);
}

.avatar-crop-zoom {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.avatar-crop-zoom input[type="range"] {
  width: 100%;
}

@keyframes heroAmbientDrift {
  from {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }

  to {
    transform: translate3d(2%, 1.5%, 0) scale(1.06);
  }
}

@keyframes heroLightSweep {
  0%,
  100% {
    opacity: 0.08;
    transform: translate3d(-18%, 0, 0) scaleX(0.96);
  }

  50% {
    opacity: 0.2;
    transform: translate3d(10%, 0, 0) scaleX(1.02);
  }
}

@keyframes heroOverlayPulse {
  0%,
  100% {
    opacity: 0.88;
  }

  50% {
    opacity: 1;
  }
}

@keyframes heroLogoFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -8px, 0);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 980px) {
  .section-grid,
  .account-layout,
  .ticket-layout,
  .profile-grid,
  .settings-grid,
  .forum-grid,
  .messages-layout,
  .community-summary-grid {
    grid-template-columns: 1fr;
  }

  .forum-hero-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .forum-hero-actions {
    justify-content: flex-start;
  }

  .forum-browse-controls {
    grid-template-columns: 1fr;
  }

  .hero-body {
    padding-right: 0.95rem;
  }

  .hero-tracker-panel {
    position: static;
    width: auto;
    margin: 0.9rem 0.9rem 0.9rem;
    margin-top: 0;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .profile-hero-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-hero-side {
    align-items: flex-start;
    min-width: 0;
    width: 100%;
  }

  .profile-hero-top-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .profile-hero-social-group {
    width: 100%;
    margin-bottom: 0.85rem;
  }

  .profile-action-menu,
  .profile-action-menu-trigger {
    width: 100%;
  }

  .profile-action-menu-panel {
    left: 0;
    right: auto;
    min-width: 100%;
  }

  .profile-hero-side .morality-vote-actions {
    justify-content: flex-start;
  }

  .profile-hero-side #profileActionStatus,
  .profile-hero-side #alignmentVoteStatus {
    text-align: left;
  }

  .profile-link-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    gap: 0.35rem 0.6rem;
  }

  .community-friend-card {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .community-friend-actions {
    justify-content: flex-start;
  }

  .panel,
  .hero-body {
    padding: 0.95rem;
  }

  .hero-banner {
    min-height: 330px;
  }

  .tracker-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .server-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-header {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-banner::before,
  .hero-banner::after,
  .hero-banner-overlay,
  .hero-logo {
    animation: none;
  }

  .message-widget {
    animation: none;
    transition: none;
    transform: none;
  }

  /* The .is-closing transform shifts the widget down/right as a plain (non-animated)
     declaration, so without this it would visibly "shift down" instead of closing. */
  .message-widget.is-closing {
    transform: none;
  }

  /* Panes normally fade in via their open keyframes (opacity 0 -> 1). With animations
     disabled they must be visible up-front or the popup body renders empty. */
  .message-widget-chat-card,
  .message-widget-friend-card {
    opacity: 1;
    transform: none;
  }
}

.statistics-shell {
  width: min(var(--page-max-width), calc(100% - 1.5rem));
  margin: 0.9rem auto 2rem;
  display: grid;
  gap: 0;
}

.statistics-header,
.statistics-tabbar,
.statistics-board-card,
.statistics-heatmap-card {
  background:
    radial-gradient(circle at top center, rgba(232, 135, 49, 0.05), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--panel);
}

.statistics-tab-shell {
  padding: 0.7rem 0.8rem 0.95rem;
  overflow: hidden;
  background:
    radial-gradient(circle at top center, rgba(232, 135, 49, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--panel);
}

.statistics-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.15rem 1.2rem;
  margin-bottom: 0.95rem;
}

.statistics-header-copy {
  max-width: 58rem;
}

.statistics-header-copy h1 {
  margin-top: 0.25rem;
  font-size: clamp(2rem, 3vw, 3rem);
}

.statistics-intro {
  margin: 0.7rem 0 0;
  max-width: 52rem;
  color: var(--muted);
  line-height: 1.6;
}

.statistics-header-meta {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.statistics-tabbar {
  padding: 0 0.3rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
  align-items: end;
  background: transparent;
  margin-top: -0.1rem;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 2;
}

/* Focused player view: Leaderboard/Map tabs are hidden, so the bar shows 2 columns.
   .statistics-tab-button is display:inline-flex, which would otherwise defeat [hidden]. */
.statistics-tabbar[data-player-focus="true"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.statistics-tab-button[hidden] {
  display: none !important;
}

/* Player identity banner shown in the statistics hero while viewing another player. */
.statistics-player-banner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.85rem;
}
.statistics-player-banner[hidden] {
  display: none !important;
}
.statistics-player-banner-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(232, 135, 49, 0.4);
  background: rgba(16, 24, 37, 0.7);
}
.statistics-player-banner-avatar[hidden] {
  display: none;
}

.statistics-tab-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  border: 1px solid rgba(92, 125, 182, 0.18);
  background: linear-gradient(180deg, rgba(19, 29, 45, 0.92), rgba(16, 24, 36, 0.98));
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0.88rem 1rem 0.82rem;
  border-radius: 18px;
  cursor: pointer;
  overflow: hidden;
  transform: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.statistics-tab-button::after {
  content: "";
  position: absolute;
  inset: auto 1.1rem 0.56rem;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(232, 135, 49, 0), rgba(232, 135, 49, 0.34), rgba(255, 179, 108, 0));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.statistics-tab-button::before {
  content: none;
}

.statistics-tab-button:hover,
.statistics-tab-button:focus-visible {
  color: var(--text);
  border-color: rgba(232, 135, 49, 0.28);
  transform: translateY(-1px);
  outline: none;
}

.statistics-tab-button.is-active {
  color: var(--text);
  border-color: rgba(232, 135, 49, 0.42);
  background:
    radial-gradient(circle at 50% -10%, rgba(232, 135, 49, 0.16), transparent 52%),
    linear-gradient(180deg, rgba(23, 34, 53, 0.98), rgba(18, 28, 45, 0.98) 32%, rgba(16, 24, 36, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 10px 24px rgba(0, 0, 0, 0.18);
  transform: none;
  z-index: 1;
}

.statistics-tab-button.is-active::after {
  opacity: 1;
}

.statistics-tab-shell > .statistics-tab-panel > .panel {
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  padding-top: 1rem;
}

.statistics-tab-panel {
  display: grid;
  gap: 0.95rem;
  margin-top: 0;
}

.statistics-tab-panel[hidden] {
  display: none;
}

.statistics-board-card {
  padding: 1rem 1.05rem;
}

.statistics-heatmap-card {
  padding: 1rem 1.05rem;
}

.statistics-titles-card {
  padding: 1rem 1.05rem;
}

.statistics-titles-card .statistics-board-head {
  min-height: 0;
  margin: 0;
}

.statistics-titles-card .statistics-board-head:empty,
.statistics-titles-card .statistics-board-head > div:empty {
  display: none;
}

.statistics-titles-card #titlesIntro:empty {
  display: none;
}

.statistics-title-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 300px));
  justify-content: start;
  gap: 0.9rem;
}

/* Another player's earned-titles view: a denser grid of compact title tiles. */
.statistics-title-grid.is-earned-list {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.6rem;
}
.statistics-title-earned-item {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(92, 125, 182, 0.18);
  background: linear-gradient(180deg, rgba(19, 29, 45, 0.6), rgba(16, 24, 36, 0.72));
}
/* The whole tile is a subtle left-to-right progress bar toward the next tier. The
   background encodes the CURRENT tier and the fill encodes the NEXT tier:
   to Tier 1 = ember (default) · on Tier 1 -> 2 = bronze bg / silver bar ·
   on Tier 2 -> 3 = silver bg / gold bar · maxed = gold + glow. */
.statistics-title-earned-fill {
  position: absolute;
  inset: 0;
  width: var(--earned-progress, 0%);
  background: linear-gradient(90deg, rgba(232, 135, 49, 0.06), rgba(232, 135, 49, 0.17));
  border-right: 1px solid rgba(232, 135, 49, 0.28);
  pointer-events: none;
  transition: width 0.6s ease;
}
.statistics-title-earned-name {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
/* On Tier 1, progressing to Tier 2: bronze background, silver bar. */
.statistics-title-earned-item.earned-tier-1 {
  border-color: rgba(205, 127, 50, 0.42);
  background: linear-gradient(180deg, rgba(205, 127, 50, 0.13), rgba(16, 24, 36, 0.72));
}
.statistics-title-earned-item.earned-tier-1 .statistics-title-earned-fill {
  background: linear-gradient(90deg, rgba(200, 208, 220, 0.07), rgba(210, 218, 230, 0.27));
  border-right-color: rgba(216, 224, 236, 0.46);
}
/* On Tier 2, progressing to Tier 3: silver background, gold bar. */
.statistics-title-earned-item.earned-tier-2 {
  border-color: rgba(198, 206, 218, 0.36);
  background: linear-gradient(180deg, rgba(198, 206, 218, 0.11), rgba(16, 24, 36, 0.72));
}
.statistics-title-earned-item.earned-tier-2 .statistics-title-earned-fill {
  background: linear-gradient(90deg, rgba(255, 200, 70, 0.08), rgba(255, 200, 70, 0.27));
  border-right-color: rgba(255, 210, 90, 0.46);
}
/* Maxed-out track: full gold bar + a gentle gold glow. */
.statistics-title-earned-item.is-maxed {
  border-color: rgba(255, 200, 70, 0.6);
  background: linear-gradient(180deg, rgba(255, 200, 70, 0.14), rgba(16, 24, 36, 0.72));
  animation: earnedTitleGlow 2.6s ease-in-out infinite;
}
.statistics-title-earned-item.is-maxed .statistics-title-earned-fill {
  width: 100%;
  border-right: 0;
  background: linear-gradient(90deg, rgba(255, 200, 70, 0.18), rgba(255, 200, 70, 0.3));
}
@keyframes earnedTitleGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 200, 70, 0.3), 0 0 12px rgba(255, 200, 70, 0.24); }
  50% { box-shadow: 0 0 0 1px rgba(255, 200, 70, 0.5), 0 0 22px rgba(255, 200, 70, 0.48); }
}
@media (prefers-reduced-motion: reduce) {
  .statistics-title-earned-item.is-maxed { animation: none; box-shadow: 0 0 0 1px rgba(255, 200, 70, 0.42), 0 0 16px rgba(255, 200, 70, 0.36); }
  .statistics-title-earned-fill { transition: none; }
}

.statistics-title-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 1rem;
}

.statistics-title-filter-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.statistics-title-filter-button:hover,
.statistics-title-filter-button:focus-visible,
.statistics-title-filter-button.is-active {
  border-color: rgba(232, 135, 49, 0.5);
  background: rgba(232, 135, 49, 0.12);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(232, 135, 49, 0.12);
}

.statistics-title-card {
  --title-tier-color: #f58a2d;
  --title-tier-color-deep: #d55f24;
  display: grid;
  gap: 0.8rem;
  min-height: 350px;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(232, 135, 49, 0.12), transparent 38%),
    rgba(255, 255, 255, 0.025);
}

.statistics-title-card.title-tier-bronze {
  --title-tier-color: #b06a38;
  --title-tier-color-deep: #7f4527;
  border-color: rgba(176, 106, 56, 0.52);
  background:
    radial-gradient(circle at 50% 38%, rgba(176, 106, 56, 0.18), transparent 42%),
    radial-gradient(circle at top right, rgba(176, 106, 56, 0.22), transparent 40%),
    linear-gradient(180deg, rgba(75, 42, 25, 0.18), rgba(10, 15, 25, 0.18)),
    rgba(255, 255, 255, 0.025);
}

.statistics-title-card.title-tier-silver {
  --title-tier-color: #cbd5e1;
  --title-tier-color-deep: #8b99aa;
  border-color: rgba(190, 199, 211, 0.48);
  background:
    radial-gradient(circle at 50% 38%, rgba(203, 213, 225, 0.14), transparent 42%),
    radial-gradient(circle at top right, rgba(190, 199, 211, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(58, 68, 82, 0.2), rgba(10, 15, 25, 0.18)),
    rgba(255, 255, 255, 0.025);
}

.statistics-title-card.title-tier-gold {
  --title-tier-color: #ffc465;
  --title-tier-color-deep: #d9922e;
  border-color: rgba(255, 190, 92, 0.58);
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 196, 101, 0.18), transparent 42%),
    radial-gradient(circle at top right, rgba(255, 190, 92, 0.24), transparent 40%),
    linear-gradient(180deg, rgba(83, 56, 22, 0.2), rgba(10, 15, 25, 0.18)),
    rgba(255, 255, 255, 0.025);
}

.statistics-title-card.is-earned {
  border-color: rgba(232, 135, 49, 0.24);
}

.statistics-title-card.is-equipped {
  border-color: rgba(255, 179, 108, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 18px 36px rgba(0, 0, 0, 0.18);
}

.statistics-title-card.title-tier-bronze.is-earned,
.statistics-title-card.title-tier-bronze.is-equipped {
  border-color: rgba(176, 106, 56, 0.72);
}

.statistics-title-card.title-tier-silver.is-earned,
.statistics-title-card.title-tier-silver.is-equipped {
  border-color: rgba(190, 199, 211, 0.68);
}

.statistics-title-card.title-tier-gold.is-earned,
.statistics-title-card.title-tier-gold.is-equipped {
  border-color: rgba(255, 190, 92, 0.78);
}

.statistics-title-card-head {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 2rem;
  text-align: center;
}

.statistics-title-card-head h3 {
  margin: 0;
  width: 100%;
}

.statistics-title-track {
  margin: -0.35rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.statistics-title-earned-tier {
  margin: -0.15rem 0 0;
  padding: 0.52rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  color: rgba(206, 219, 240, 0.82);
  font-size: 0.84rem;
  font-weight: 800;
  text-align: center;
}

.statistics-title-ring {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 17rem;
  margin: 0.25rem 0 0.45rem;
  overflow: visible;
}

.statistics-title-ring::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(16.6rem, 78vw);
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--title-tier-color) 22%, transparent) 0 38%, transparent 67%);
  filter: blur(14px);
  opacity: 0.72;
  transform: translate(-50%, -50%);
}

.statistics-title-ring-svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(15.8rem, 76vw);
  height: min(15.8rem, 76vw);
  aspect-ratio: 1;
  overflow: visible;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.26));
  transform: translate(-50%, -50%);
}

.statistics-title-ring-track,
.statistics-title-ring-value {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}

.statistics-title-ring-track {
  stroke: rgba(255, 255, 255, 0.15);
}

.statistics-title-ring-value {
  stroke: var(--title-tier-color);
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  filter:
    drop-shadow(0 0 5px var(--title-tier-color))
    drop-shadow(0 0 14px color-mix(in srgb, var(--title-tier-color) 62%, transparent));
}

.statistics-title-ring-callout-line {
  stroke: rgba(232, 239, 252, 0.58);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.statistics-title-ring-callout-label {
  fill: var(--text);
  font-size: 0.5rem;
  font-weight: 800;
  dominant-baseline: middle;
}

.statistics-title-ring-callout-label.is-left {
  text-anchor: end;
}

.statistics-title-ring-core {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  gap: 0.16rem;
  justify-items: center;
  color: rgba(206, 219, 240, 0.76);
  text-align: center;
  width: min(9.4rem, 56vw);
  transform: translate(-50%, -50%);
}

.statistics-title-ring-core span {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.1;
}

.statistics-title-ring-core strong {
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

.statistics-title-ring-core small {
  color: var(--muted);
  font-size: 0.72rem;
}

.statistics-title-state,
.statistics-title-locked {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.statistics-title-progress {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.statistics-title-card-footer {
  margin-top: auto;
}

.statistics-title-equip-btn {
  width: 100%;
}

.statistics-title-tiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.statistics-title-tier-btn {
  min-height: 2.6rem;
  padding: 0.4rem 0.35rem;
  font-size: 0.72rem;
  line-height: 1.15;
  white-space: normal;
}

.statistics-title-tier-btn.is-locked {
  background: rgba(16, 24, 37, 0.55);
  border-color: rgba(84, 117, 173, 0.16);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.55;
}

.statistics-mystats-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}

.statistics-visibility {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

/* Hidden when viewing another player's stats (you can't toggle their visibility);
   the display:flex above would otherwise override the UA [hidden] rule. */
.statistics-visibility[hidden] {
  display: none !important;
}

.statistics-visibility-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.statistics-visibility-options {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  background: rgba(16, 24, 37, 0.7);
  border: 1px solid rgba(84, 117, 173, 0.18);
  border-radius: 999px;
}

.statistics-visibility-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  transition: color 120ms ease, background 120ms ease;
}

.statistics-visibility-btn:hover {
  color: var(--text);
}

.statistics-visibility-btn.is-active {
  color: #1a0f07;
  background: linear-gradient(135deg, var(--accent), #cc5b2d);
}

/* Search field + "Back to my stats" sit together on one line at the right of the
   toolbar (nowrap so the Back button stays beside the search, not under it). */
.statistics-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-left: auto;
  min-width: 0;
}
.statistics-toolbar-actions .statistics-player-search {
  min-width: 0;
}
.statistics-toolbar-actions #myStatsViewingBack {
  flex: 0 0 auto;
  white-space: nowrap;
}

.statistics-player-search {
  position: relative;
  width: min(320px, 100%);
}

.statistics-player-search-input {
  width: 100%;
}

.statistics-player-search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.4rem);
  right: 0;
  left: 0;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.35rem;
  background: rgba(8, 13, 24, 0.98);
  border: 1px solid rgba(84, 117, 173, 0.22);
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
}

.statistics-player-search-empty {
  margin: 0;
  padding: 0.5rem 0.6rem;
}

.statistics-player-search-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.55rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.statistics-player-search-result:hover {
  background: rgba(17, 24, 37, 0.9);
}

.statistics-player-search-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(140deg, rgba(232, 135, 49, 0.32), rgba(126, 199, 255, 0.16));
  border: 1px solid rgba(255, 179, 108, 0.32);
  font-weight: 800;
}

.statistics-player-search-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.statistics-player-search-name {
  min-width: 0;
  display: grid;
}

.statistics-player-search-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-player-search-name small {
  color: var(--muted);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.statistics-mystats-viewing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  background: rgba(232, 135, 49, 0.1);
  border: 1px solid rgba(255, 179, 108, 0.3);
  border-radius: 12px;
}

.statistics-mystats-viewing strong {
  color: var(--text);
}

.statistics-mystats-viewing[hidden],
.statistics-player-search-results[hidden] {
  display: none;
}

.statistics-title-tier-list {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.statistics-title-tier-list-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  background: rgba(16, 24, 37, 0.5);
  border: 1px solid rgba(84, 117, 173, 0.14);
  font-size: 0.78rem;
}

.statistics-title-tier-list-item.is-equipped {
  border-color: rgba(255, 179, 108, 0.45);
  background: rgba(232, 135, 49, 0.12);
}

.statistics-title-tier-list-tier {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.statistics-title-tier-list-name {
  min-width: 0;
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.statistics-title-tier-list-flag {
  margin-left: 0.4rem;
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.statistics-title-tier-list-empty {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
}

.statistics-group-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.statistics-group-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  min-width: 11rem;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.statistics-group-button:hover,
.statistics-group-button:focus-visible,
.statistics-group-button.is-active {
  color: var(--text);
  border-color: rgba(232, 135, 49, 0.38);
  background: linear-gradient(180deg, rgba(232, 135, 49, 0.16), rgba(255, 255, 255, 0.04));
  transform: translateY(-1px);
}

/* BM-272: the scope switch (Individual/Clan) is a compact segmented pill so it
   reads as a higher-level mode switch, clearly distinct from the larger boxy
   Combat/Raid category buttons below it. */
/* Group the scope toggle (Individual/Clan) and its nested timeframe sub-toggle
   (Current Wipe/All Time) in one bordered card so the timeframe clearly reads
   as a child of the selected scope rather than a separate category. */
/* Current Wipe / All Time sits as a small right-aligned filter directly under
   the leaderboard table. */
.leaderboard-timeframe-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

.statistics-scope-bar {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 0.25rem;
  padding: 0.28rem;
  margin-bottom: 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.26);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Current/All-time is a secondary sub-filter under the scope pill: same pill
   shape but a subtler (tinted-outline) active state so it doesn't compete with
   the bold scope toggle above it or the boxy Combat/Raid tiles below. */
.statistics-scope-bar.statistics-timeframe-bar {
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.statistics-scope-bar.statistics-timeframe-bar .statistics-group-button {
  padding: 0.36rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.statistics-scope-bar.statistics-timeframe-bar .statistics-group-button.is-active {
  color: var(--accent-2);
  background: rgba(232, 135, 49, 0.15);
  border: 1px solid rgba(232, 135, 49, 0.5);
  box-shadow: inset 0 0 12px rgba(232, 135, 49, 0.12);
  transform: none;
}

.statistics-scope-bar .statistics-group-button {
  min-width: 0;
  padding: 0.46rem 1.5rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.statistics-scope-bar .statistics-group-button:hover,
.statistics-scope-bar .statistics-group-button:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  transform: none;
}

.statistics-scope-bar .statistics-group-button.is-active {
  color: #1a1109;
  background: linear-gradient(135deg, #ffc188, #e8852f);
  border: 0;
  transform: none;
  box-shadow: 0 5px 16px rgba(232, 135, 49, 0.4), inset 0 1px 0 rgba(255, 236, 212, 0.55);
}

.statistics-board-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.statistics-board-head h2 {
  margin-top: 0.28rem;
}

.statistics-board-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.statistics-self-card {
  padding: 1.1rem 1.1rem 1.2rem;
}

.statistics-self-intro {
  max-width: 62rem;
  margin: 0 0 1rem;
  line-height: 1.65;
}

.statistics-self-grid,
.statistics-self-best-grid {
  display: grid;
  gap: 0.95rem;
}

.statistics-self-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0.95rem;
}

.statistics-self-best-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.statistics-self-panel,
.statistics-self-visual-panel,
.statistics-self-best-panel,
.statistics-self-best-wipe {
  position: relative;
  overflow: visible;
  border: 1px solid rgba(84, 117, 173, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(232, 135, 49, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(11, 17, 30, 0.96), rgba(7, 12, 21, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.statistics-self-panel::after,
.statistics-self-visual-panel::after,
.statistics-self-best-panel::after,
.statistics-self-best-wipe::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 179, 108, 0.36), rgba(255, 179, 108, 0));
  pointer-events: none;
}

.statistics-self-panel,
.statistics-self-visual-panel,
.statistics-self-best-panel {
  padding: 1rem;
}

.statistics-self-visual-panel {
  margin-bottom: 0.95rem;
}

.statistics-self-best-wipe {
  padding: 0.95rem;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  animation: statisticsSelfFadeUp 320ms ease both;
}

.statistics-self-panel:hover,
.statistics-self-visual-panel:hover,
.statistics-self-best-panel:hover,
.statistics-self-best-wipe:hover {
  transform: translateY(-2px);
  border-color: rgba(232, 135, 49, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 32px rgba(0, 0, 0, 0.24);
}

.statistics-self-panel-head,
.statistics-self-best-wipe-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.95rem;
}

.statistics-self-panel-head h3,
.statistics-self-best-wipe-head strong {
  margin: 0.24rem 0 0;
}

.statistics-self-panel-body {
  display: grid;
  gap: 0.95rem;
}

.statistics-self-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.statistics-self-metric {
  position: relative;
  display: grid;
  gap: 0.56rem;
  padding: 0.9rem 0.95rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018));
  border: 1px solid rgba(84, 117, 173, 0.16);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  animation: statisticsSelfFadeUp 320ms ease both;
}

.statistics-self-metric:hover {
  z-index: 30;
  transform: translateY(-1px);
  background: rgba(232, 135, 49, 0.08);
  border-color: rgba(232, 135, 49, 0.2);
}

.statistics-self-detail-item:hover,
.statistics-self-metric:focus-within,
.statistics-self-detail-item:focus-within,
.statistics-self-detail-item:has(.statistics-info-tooltip:hover) {
  position: relative;
  z-index: 30;
}

.statistics-self-metric-label,
.statistics-self-best-wipe-kicker {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.statistics-self-metric-value {
  font-size: 1.4rem;
  line-height: 1.08;
  color: var(--text);
}

.statistics-self-metric-detail {
  color: rgba(206, 219, 240, 0.72);
  font-size: 0.86rem;
}

.statistics-self-score-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(15rem, 1fr);
  gap: 1rem;
  align-items: end;
  padding: 0.95rem;
  border-radius: 14px;
  /* Border follows the SAME 135deg direction as the fill (ember at the top-left,
     fading out toward the bottom-right) so it blends into the panel instead of
     reading as a stray orange line that overshoots the corner. The fill paints
     to the padding-box and the matching border gradient paints to the border-box. */
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, rgba(232, 135, 49, 0.14), rgba(255, 255, 255, 0.025) 44%, rgba(9, 16, 28, 0.78)) padding-box,
    linear-gradient(135deg, rgba(232, 135, 49, 0.5), rgba(232, 135, 49, 0.06) 55%, rgba(232, 135, 49, 0)) border-box,
    #0a101b padding-box;
}

.statistics-self-score-copy,
.statistics-self-score-track {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.statistics-self-score-copy strong {
  color: var(--text);
  font-size: clamp(1.75rem, 4vw, 2.7rem);
  line-height: 1;
}

.statistics-self-score-rule {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.7rem;
  align-items: center;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.statistics-self-score-rule::before,
.statistics-self-score-rule::after {
  content: "";
  height: 1px;
  min-width: 2rem;
  background: linear-gradient(90deg, transparent, rgba(232, 239, 252, 0.56));
}

.statistics-self-score-rule::after {
  background: linear-gradient(90deg, rgba(232, 239, 252, 0.56), transparent);
}

.statistics-self-score-copy > span:last-child {
  color: rgba(206, 219, 240, 0.76);
  font-size: 0.9rem;
}

.statistics-self-score-rank,
.statistics-self-tracker-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  color: rgba(206, 219, 240, 0.7);
  font-size: 0.82rem;
}

.statistics-self-score-rank strong,
.statistics-self-tracker-meta strong {
  color: var(--text);
  white-space: nowrap;
}

.statistics-self-tracker-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.statistics-progress-rail {
  position: relative;
  display: block;
  width: 100%;
  height: 0.46rem;
  overflow: hidden;
  border-radius: 999px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0 0.35rem, rgba(255, 255, 255, 0.03) 0.35rem 0.7rem),
    rgba(255, 255, 255, 0.11);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.42);
}

.statistics-progress-rail span {
  display: block;
  height: 100%;
  min-width: 0.2rem;
  border-radius: inherit;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 0.42rem, rgba(255, 255, 255, 0) 0.42rem 0.84rem),
    linear-gradient(90deg, #f58a2d, #d55f24);
  box-shadow: 0 0 18px rgba(232, 135, 49, 0.28);
}

.statistics-mini-progress-value {
  display: inline-flex;
  min-width: 2.5rem;
  justify-content: flex-end;
  color: var(--text);
}

.statistics-self-detail-item .statistics-progress-rail {
  width: min(8rem, 28vw);
}

.statistics-ring-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.statistics-ring-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.65rem;
  min-height: 14rem;
  padding: 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(84, 117, 173, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.014));
  animation: statisticsSelfFadeUp 320ms ease both;
}

/* Card title sits at the top of the card (not inside the ring) so it can never
   clip through the circular progress graphic. */
.statistics-ring-title {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--text);
}

.statistics-ring-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 9.8rem;
}

.statistics-ring-visual::before {
  content: "";
  width: min(13rem, 58vw);
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle, #09101b 0 54%, transparent 55%),
    conic-gradient(from -35deg, #f58a2d 0 var(--metric-deg), rgba(255, 255, 255, 0.13) var(--metric-deg) 360deg);
  box-shadow:
    inset 0 0 0 0.75rem rgba(255, 255, 255, 0.035),
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 18px 44px rgba(0, 0, 0, 0.25);
}

.statistics-ring-visual::after {
  content: "";
  position: absolute;
  width: min(9.2rem, 42vw);
  aspect-ratio: 1;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(8, 13, 23, 0.98), rgba(6, 10, 18, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.statistics-ring-visual::before,
.statistics-ring-visual::after {
  content: none;
}

.statistics-ring-svg {
  width: min(9.75rem, 46vw);
  height: min(9.75rem, 46vw);
  aspect-ratio: 1;
  overflow: visible;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.28));
}

.statistics-ring-track,
.statistics-ring-value {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
}

.statistics-ring-track {
  stroke: rgba(255, 255, 255, 0.15);
}

.statistics-ring-value {
  stroke: #f58a2d;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
}

.statistics-ring-svg-callout-line {
  stroke: rgba(232, 239, 252, 0.66);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.statistics-ring-svg-callout-label {
  fill: var(--text);
  font-size: 0.46rem;
  font-weight: 800;
  dominant-baseline: middle;
}

.statistics-ring-svg-callout-label.is-left {
  text-anchor: end;
}

.statistics-ring-core {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  color: rgba(206, 219, 240, 0.74);
  text-align: center;
}

.statistics-ring-core span {
  font-size: 0.86rem;
  font-weight: 800;
}

.statistics-ring-core strong {
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.1;
}

.statistics-ring-core small {
  font-size: 0.84rem;
}

.statistics-ring-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.72rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 0.9rem;
}

.statistics-ring-legend span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 0;
}

.statistics-ring-legend i {
  width: 3rem;
  height: 0.42rem;
  border-radius: 999px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 0.38rem, rgba(255, 255, 255, 0) 0.38rem 0.76rem),
    linear-gradient(90deg, #f58a2d, #d55f24);
}

.statistics-ring-legend i.is-muted {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0 0.38rem, rgba(255, 255, 255, 0) 0.38rem 0.76rem),
    rgba(255, 255, 255, 0.16);
}

.statistics-visual-score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.statistics-visual-score-tile {
  display: grid;
  gap: 0.36rem;
  align-content: start;
  min-height: 7.8rem;
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(84, 117, 173, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018));
  text-align: center;
}

.statistics-visual-score-tile strong {
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1;
}

.statistics-visual-score-tile > span:not(.statistics-progress-rail):last-of-type {
  color: rgba(206, 219, 240, 0.72);
  font-weight: 800;
}

.statistics-visual-score-tile small {
  color: var(--muted);
}

.statistics-score-help-label,
.statistics-legacy-score-label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.38rem;
  min-width: 0;
}

.statistics-inline-link {
  color: var(--text);
  text-decoration: none;
}

.statistics-inline-link:hover,
.statistics-inline-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.statistics-info-tooltip {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid rgba(206, 219, 240, 0.38);
  color: rgba(232, 239, 252, 0.9);
  background: rgba(16, 24, 37, 0.94);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.statistics-info-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.55rem);
  z-index: 12;
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.7rem 0.78rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 135, 49, 0.46);
  background: #070b13;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255, 255, 255, 0.04);
  color: #f4f7ff;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.25rem);
  transition: opacity 140ms ease, transform 140ms ease;
}

.statistics-self-metric-detail .statistics-info-tooltip::after {
  left: 0;
  right: auto;
}

.statistics-info-tooltip:hover::after,
.statistics-info-tooltip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.statistics-info-tooltip:focus-visible {
  outline: 2px solid rgba(232, 135, 49, 0.72);
  outline-offset: 2px;
}

.statistics-self-detail-list {
  display: grid;
  gap: 0.6rem;
}

.statistics-self-detail-item {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  padding: 0.72rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.statistics-self-detail-item strong {
  color: var(--text);
  text-align: right;
}

@keyframes statisticsSelfFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.statistics-heatmap-actions {
  display: grid;
  grid-template-columns: auto auto minmax(280px, 1fr);
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.statistics-map-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.statistics-toggle-option {
  display: inline-flex !important;
  align-items: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.2rem 0.4rem 0.2rem 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.statistics-toggle-option input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.statistics-map-compact-toggle {
  position: relative;
  min-height: auto;
  padding: 0;
  margin: 0;
  border-radius: 999px;
  cursor: pointer;
}

.statistics-map-compact-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.statistics-map-compact-toggle span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.55rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(178, 189, 180, 0.92);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.statistics-map-compact-toggle span::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.statistics-map-compact-toggle:hover span,
.statistics-map-compact-toggle:focus-within span {
  transform: translateY(-1px);
  color: rgba(239, 244, 236, 0.96);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.statistics-map-compact-toggle:has(input:checked) span {
  color: var(--text);
  border-color: rgba(232, 135, 49, 0.34);
  background: linear-gradient(180deg, rgba(232, 135, 49, 0.18), rgba(136, 180, 102, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.statistics-map-compact-toggle:has(input:checked) span::before {
  background: linear-gradient(180deg, rgba(232, 135, 49, 0.95), rgba(136, 180, 102, 0.9));
  box-shadow: 0 0 0 1px rgba(255, 244, 227, 0.18), 0 0 10px rgba(232, 135, 49, 0.28);
  transform: scale(1.1);
}

.statistics-pin-toolbar {
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(260px, 1.2fr);
  gap: 0.75rem;
  align-items: end;
}

.statistics-pin-toolbar label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.statistics-pin-toolbar input {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.statistics-pin-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.statistics-pin-status {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.statistics-player-history {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top center, rgba(232, 135, 49, 0.05), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--panel);
}

.statistics-player-history-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.statistics-player-search-label {
  min-width: min(320px, 100%);
  flex: 1 1 280px;
}

.statistics-player-search-label input {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.72rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.statistics-player-history-status {
  min-height: 1.3rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.statistics-player-self-copy {
  display: grid;
  gap: 0.16rem;
  min-width: 220px;
}

.statistics-player-self-copy strong {
  color: var(--text);
}

.statistics-player-self-copy span {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.statistics-player-search-results,
.statistics-player-history-list {
  display: grid;
  gap: 0.55rem;
}

.statistics-player-search-result,
.statistics-player-history-entry {
  display: grid;
  gap: 0.16rem;
  width: 100%;
  padding: 0.78rem 0.88rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.statistics-player-search-result:hover,
.statistics-player-search-result:focus-visible,
.statistics-player-history-entry:hover,
.statistics-player-history-entry:focus-visible {
  border-color: rgba(232, 135, 49, 0.34);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.statistics-player-search-name,
.statistics-player-history-entry-title {
  font-weight: 700;
}

.statistics-player-search-meta,
.statistics-player-history-entry-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.statistics-player-history-panel {
  display: grid;
  gap: 0.8rem;
}

.statistics-player-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.statistics-heatmap-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0.95rem;
  align-items: start;
  margin-bottom: 0.95rem;
  min-width: 0;
}

.statistics-map-sidepanel {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.8rem;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top center, rgba(232, 135, 49, 0.05), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0)),
    var(--panel);
}

.statistics-map-sidepanel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.statistics-map-sidepanel-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.55rem;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(178, 189, 180, 0.92);
  padding: 0.72rem 0.95rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.statistics-map-sidepanel-tab::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.statistics-map-sidepanel-tab:hover,
.statistics-map-sidepanel-tab:focus-visible,
.statistics-map-sidepanel-tab.is-active {
  color: var(--text);
}

.statistics-map-sidepanel-tab:hover,
.statistics-map-sidepanel-tab:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.statistics-map-sidepanel-tab.is-active {
  border-color: rgba(232, 135, 49, 0.34);
  background: linear-gradient(180deg, rgba(232, 135, 49, 0.18), rgba(136, 180, 102, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.statistics-map-sidepanel-tab.is-active::before {
  background: linear-gradient(180deg, rgba(232, 135, 49, 0.95), rgba(136, 180, 102, 0.9));
  box-shadow: 0 0 0 1px rgba(255, 244, 227, 0.18), 0 0 10px rgba(232, 135, 49, 0.28);
  transform: scale(1.1);
}

.statistics-map-sidepanel-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.75rem;
  min-height: 0;
}

.statistics-map-sidepanel-section[hidden] {
  display: none !important;
}

.statistics-map-sidepanel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 0.7rem;
}

.statistics-map-sidepanel-head h3 {
  margin: 0.2rem 0 0;
}

.statistics-map-zone-list {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  min-height: 0;
  overflow: auto;
  padding-right: 0.1rem;
}

.statistics-zone-rank-card {
  display: grid;
  gap: 0.18rem;
  padding: 0.72rem 0.82rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.statistics-zone-rank-head {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: baseline;
}

.statistics-zone-rank-meta,
.statistics-map-timeline-actions {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.statistics-map-timeline-actions {
  display: grid;
  gap: 0.85rem;
  align-items: start;
}

#heatmapPlayerStatus:empty {
  display: none;
}

.statistics-map-timeline-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.statistics-trusted-friend-picker {
  display: grid;
  gap: 0.55rem;
  min-width: min(100%, 24rem);
}

.statistics-trusted-friend-picker-label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.statistics-trusted-friend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.statistics-trusted-friend-list.is-empty {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.statistics-trusted-history-group {
  display: grid;
  gap: 0.7rem;
  min-height: 0;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.statistics-trusted-history-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.55rem;
  align-items: baseline;
}

.statistics-trusted-history-head h4 {
  margin: 0;
  font-size: 1rem;
}

.statistics-timeline-death-card {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 68, 68, 0.18);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 68, 68, 0.1), transparent 34%),
    rgba(255, 255, 255, 0.025);
}

.statistics-timeline-death-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.statistics-timeline-death-card-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 68, 68, 0.22);
  color: rgb(255, 154, 154);
  font-size: 0.74rem;
}

.statistics-timeline-death-list {
  display: grid;
  gap: 0.45rem;
  max-height: calc((7.35rem * 4) + (0.45rem * 3));
  overflow-y: auto;
  padding-right: 0.2rem;
}

.statistics-timeline-event-list {
  display: grid;
  gap: 0.55rem;
  max-height: calc((7.35rem * 4) + (0.55rem * 3));
  overflow-y: auto;
  padding-right: 0.2rem;
}

.statistics-timeline-death-row {
  border-style: solid;
  background: rgba(45, 15, 18, 0.24);
}

.statistics-timeline-death-card-empty {
  color: var(--text-muted);
  border-style: dashed;
}

.statistics-timeline-death-card-empty span {
  line-height: 1.5;
}

.statistics-player-history-head h3 {
  margin: 0.25rem 0 0;
}

.statistics-player-history-empty {
  padding: 0.9rem;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
}

.statistics-admin-player-panel {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(232, 135, 49, 0.18);
  background:
    radial-gradient(circle at 12% 18%, rgba(232, 135, 49, 0.08), transparent 35%),
    linear-gradient(180deg, rgba(20, 14, 10, 0.86), rgba(14, 12, 10, 0.82));
}

.statistics-admin-player-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.statistics-admin-player-panel-head h3 {
  margin: 0.25rem 0 0;
}

.statistics-admin-player-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.statistics-admin-player-toolbar label {
  display: grid;
  gap: 0.35rem;
  min-width: min(320px, 100%);
  flex: 1 1 280px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.statistics-admin-player-toolbar input {
  width: 100%;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.statistics-player-tab-card {
  display: grid;
  gap: 0.95rem;
}

.statistics-player-tab-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
}

.statistics-player-tab-toolbar label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.statistics-player-tab-toolbar input {
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.statistics-player-tab-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.statistics-player-tab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 0.95rem;
  align-items: start;
}

.statistics-player-tab-map {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #0b0e0f;
  aspect-ratio: 1 / 1;
}

.statistics-player-tab-map canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.statistics-player-tab-map-note {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(13, 20, 17, 0.92), rgba(16, 23, 20, 0.84));
}

.statistics-player-tab-map-note h3 {
  margin: 0.2rem 0 0;
}

.statistics-player-tab-side {
  min-height: 0;
}

.statistics-player-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.statistics-player-summary-strip span {
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.statistics-player-history-list {
  max-height: 680px;
  overflow: auto;
  padding-right: 0.15rem;
}

.statistics-player-history-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.8rem;
  margin-right: 0.45rem;
  padding: 0.14rem 0.46rem;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.statistics-player-history-badge-kill {
  background: rgba(108, 214, 153, 0.14);
  border: 1px solid rgba(108, 214, 153, 0.26);
  color: rgb(140, 231, 181);
}

.statistics-player-history-badge-death {
  background: rgba(255, 68, 68, 0.14);
  border: 1px solid rgba(255, 68, 68, 0.26);
  color: rgb(255, 132, 132);
}

.statistics-heatmap-stage {
  position: relative;
  z-index: 1;
  align-self: start;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #0b0e0f;
  aspect-ratio: var(--statistics-map-aspect-ratio, 1);
}

.statistics-map-expand-btn {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(7, 12, 13, 0.72);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.statistics-map-expand-btn:hover,
.statistics-map-expand-btn:focus-visible {
  border-color: rgba(232, 135, 49, 0.36);
  background: rgba(20, 25, 24, 0.88);
  transform: translateY(-1px);
}

.statistics-map-expand-btn svg,
.statistics-map-modal-close svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.statistics-heatmap-stage canvas {
  width: 100%;
  max-width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.statistics-heatmap-pin-overlay {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 14px rgba(255, 0, 140, 0.65));
}

.statistics-heatmap-global-pin-overlay {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  width: 0;
  height: 0;
  pointer-events: none;
  overflow: visible;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.34));
}

.statistics-heatmap-global-pin-overlay[hidden] {
  display: none !important;
}

.statistics-heatmap-global-pin-overlay-test {
  filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.36));
}

.statistics-heatmap-global-pin-overlay-test .statistics-heatmap-pin-overlay-marker {
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 230, 196, 0.9), rgba(255, 208, 150, 0.28) 32%, transparent 34%),
    linear-gradient(180deg, rgba(15, 32, 60, 0.98), rgba(9, 18, 34, 0.96));
  box-shadow:
    0 0 0 10px rgba(232, 135, 49, 0.12),
    0 0 0 18px rgba(96, 143, 222, 0.12),
    0 8px 18px rgba(2, 6, 14, 0.48);
}

.statistics-heatmap-global-pin-overlay-test .statistics-heatmap-pin-overlay-label {
  border-color: rgba(232, 135, 49, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 28px rgba(0, 0, 0, 0.32);
}

.statistics-heatmap-pin-overlay[hidden] {
  display: none !important;
}

.statistics-heatmap-pin-overlay-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 196, 140, 0.96);
  transform: translate(-50%, -50%);
  transform-origin: center;
}

.statistics-heatmap-pin-overlay-marker::before,
.statistics-heatmap-pin-overlay-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  background: #fff6a8;
  transform: translate(-50%, -50%);
}

.statistics-heatmap-pin-overlay-marker::before {
  width: 2rem;
  height: 2px;
}

.statistics-heatmap-pin-overlay-marker::after {
  width: 2px;
  height: 2rem;
}

.statistics-heatmap-pin-overlay-label {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 8.75rem;
  max-width: min(18rem, 44vw);
  padding: 0.5rem 0.75rem;
  border-radius: 0.8rem;
  background:
    linear-gradient(180deg, rgba(14, 24, 43, 0.98), rgba(8, 14, 27, 0.96));
  border: 1px solid rgba(93, 131, 198, 0.28);
  color: rgba(240, 246, 255, 0.98);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.35;
  text-align: center;
  white-space: pre-line;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 28px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, calc(-100% - 1rem));
}

.statistics-map-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  --statistics-map-modal-viewport-gap: 8.5rem;
  --statistics-map-modal-max-width: min(
    calc(100vw - 2rem),
    calc((100vh - var(--statistics-map-modal-viewport-gap)) * var(--statistics-map-aspect-ratio, 1))
  );
}

.statistics-map-modal[hidden] {
  display: none !important;
}

.statistics-map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 8, 0.76);
  backdrop-filter: blur(10px);
}

.statistics-map-modal-dialog {
  position: relative;
  z-index: 1;
  width: var(--statistics-map-modal-max-width);
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 2rem);
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top center, rgba(232, 135, 49, 0.06), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(55, 88, 140, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0)),
    var(--panel-2);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.statistics-map-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
}

.statistics-map-modal-head h2 {
  margin: 0.2rem 0 0;
}

.statistics-map-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.statistics-map-modal-stage {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #0b0e0f;
  width: 100%;
  aspect-ratio: var(--statistics-map-aspect-ratio, 1);
  max-height: calc(100vh - var(--statistics-map-modal-viewport-gap));
}

.statistics-map-modal-stage canvas {
  width: 100%;
  height: auto;
  aspect-ratio: var(--statistics-map-aspect-ratio, 1);
  max-width: 100%;
  max-height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.statistics-heatmap-pin-overlay-modal .statistics-heatmap-pin-overlay-label {
  max-width: min(22rem, 48vw);
}

.statistics-heatmap-stage canvas.is-dragging {
  cursor: grabbing;
}

.statistics-heatmap-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(9, 11, 12, 0.1), rgba(9, 11, 12, 0.35));
  pointer-events: none;
}

.statistics-heatmap-empty[hidden] {
  display: none;
}

.statistics-heatmap-map-meta {
  margin-top: 0.85rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.statistics-heatmap-map-meta a {
  color: var(--text);
}

.statistics-heatmap-footer {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.statistics-table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(88, 121, 176, 0.12);
  background:
    radial-gradient(circle at top center, rgba(232, 135, 49, 0.03), transparent 30%),
    linear-gradient(180deg, rgba(19, 29, 45, 0.96), rgba(11, 18, 30, 0.98));
}

.statistics-table {
  width: 100%;
  border-collapse: collapse;
}

.statistics-table th,
.statistics-table td {
  padding: 1rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
}

.statistics-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #f3f3f3;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: nowrap;
  background: rgba(18, 28, 44, 0.98);
}

.statistics-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.statistics-sort-button:hover,
.statistics-sort-button:focus-visible {
  color: #f8b15e;
  outline: none;
}

.statistics-sort-button.is-active {
  color: #f8b15e;
}

.statistics-sort-linked-header {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.statistics-sort-button-compact {
  font-size: 0.72rem;
  color: rgba(206, 219, 240, 0.7);
}

.statistics-npc-header-link {
  color: inherit;
  text-decoration: none;
}

.statistics-npc-header-link:hover,
.statistics-npc-header-link:focus-visible {
  color: #f8b15e;
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.statistics-sort-indicator {
  min-width: 0.7rem;
  color: rgba(248, 177, 94, 0.88);
  font-size: 0.78rem;
  text-align: center;
}

.statistics-table tbody tr:hover {
  background: rgba(78, 118, 190, 0.08);
}

.statistics-rank-cell,
.statistics-value-cell {
  white-space: nowrap;
  font-weight: 700;
  color: var(--text);
}

.statistics-time-cell,
.statistics-player-meta,
.statistics-empty-cell {
  color: var(--muted);
}

.statistics-player-cell {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 260px;
}

.statistics-avatar {
  position: relative;
  overflow: hidden;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(232, 135, 49, 0.85), rgba(136, 180, 102, 0.7));
  color: #101312;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Real avatar overlays the initials; if it fails to load it is removed (onerror)
   and the initials underneath show through. */
.statistics-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.statistics-player-copy {
  display: flex;
  align-items: center;
  min-width: 0;
}

.statistics-player-meta {
  margin-top: 0.18rem;
  font-size: 0.82rem;
}

.statistics-empty-cell {
  text-align: center;
}

.leaderboard-row-link {
  color: inherit;
  text-decoration: none;
}

.leaderboard-row-link:hover {
  text-decoration: underline;
}

.tier-rank1 {
  background: rgba(245, 225, 120, 0.18);
  color: #f9efb2;
}

.tier-diamond {
  background: rgba(112, 212, 245, 0.16);
  color: #d4f4ff;
}

.tier-platinum {
  background: rgba(160, 214, 211, 0.16);
  color: #e1fffd;
}

.tier-gold {
  background: rgba(232, 183, 71, 0.16);
  color: #ffe8af;
}

.tier-silver {
  background: rgba(189, 196, 209, 0.16);
  color: #eef2f9;
}

.tier-bronze {
  background: rgba(185, 126, 88, 0.16);
  color: #f3d6c7;
}

.tier-unranked {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

@media (max-width: 980px) {
  .statistics-header,
  .statistics-board-head {
    flex-direction: column;
    align-items: stretch;
  }

  .statistics-tabbar {
    flex-wrap: wrap;
  }

  .statistics-heatmap-actions {
    grid-template-columns: repeat(2, minmax(0, max-content));
  }

  .statistics-pin-status {
    grid-column: 1 / -1;
  }

  .statistics-player-history-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .statistics-player-tab-grid {
    grid-template-columns: 1fr;
  }

  .statistics-self-grid,
  .statistics-self-best-grid,
  .statistics-self-metric-grid,
  .statistics-ring-grid,
  .statistics-visual-score-grid {
    grid-template-columns: 1fr;
  }

  .statistics-self-score-hero {
    grid-template-columns: 1fr;
  }

  .statistics-heatmap-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .statistics-tabbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .statistics-heatmap-actions {
    grid-template-columns: 1fr;
  }

  .statistics-map-toggle-group {
    width: 100%;
  }

  .statistics-map-sidepanel-tabs {
    grid-template-columns: 1fr;
  }

  .statistics-player-tab-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .statistics-admin-player-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .statistics-self-card,
  .statistics-self-panel,
  .statistics-self-visual-panel,
  .statistics-self-best-panel {
    padding: 0.9rem;
  }

  .statistics-self-panel-head,
  .statistics-self-best-wipe-head,
  .statistics-self-detail-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .statistics-self-tracker-head,
  .statistics-self-score-rank,
  .statistics-self-tracker-meta {
    align-items: flex-start;
  }

  .statistics-self-detail-item strong {
    text-align: left;
    width: 100%;
  }

  .statistics-self-detail-item .statistics-progress-rail {
    width: 100%;
  }

  .statistics-ring-card {
    min-height: auto;
  }

  .statistics-ring-visual {
    min-height: 12rem;
  }

  .statistics-ring-legend {
    grid-template-columns: 1fr;
  }

  .statistics-header-copy h1 {
    font-size: 1.9rem;
  }

  .statistics-table th,
  .statistics-table td {
    padding: 0.75rem 0.7rem;
  }

  .statistics-player-cell {
    min-width: 200px;
  }
}

.theme-switcher {
  margin-top: 1rem;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(232, 135, 49, 0.16), transparent 42%),
    rgba(255, 255, 255, 0.025);
}

.theme-switcher-label {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.theme-switcher-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.theme-choice-btn {
  min-width: 8.5rem;
}

.theme-choice-btn.is-active {
  border-color: rgba(232, 135, 49, 0.48);
  background: rgba(232, 135, 49, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body {
  line-height: 1.5;
}

.topbar {
  position: sticky;
  top: 0.75rem;
  padding: 0.7rem;
  border-radius: 22px;
  border-color: rgba(95, 130, 188, 0.16);
  background:
    linear-gradient(180deg, rgba(8, 14, 26, 0.92), rgba(4, 8, 15, 0.84)),
    rgba(4, 8, 16, 0.82);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-link {
  gap: 0.75rem;
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem 0.45rem 0.35rem;
  border-radius: 18px;
  transition: background 160ms ease, transform 160ms ease;
}

.brand-link:hover,
.brand-link:focus-visible {
  background: rgba(255, 255, 255, 0.035);
  transform: translateY(-1px);
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  transform: rotate(45deg);
}

.brand-name {
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.topbar-actions {
  flex: 1 1 auto;
  justify-content: flex-end;
  gap: 0.7rem;
}

.topnav {
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
}

.topnav-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: min(100%, 56rem);
  min-height: 3.35rem;
  padding: 0.42rem 0.35rem 0.5rem;
  border: 1px solid rgba(113, 149, 212, 0.14);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(12, 19, 33, 0.92), rgba(7, 12, 22, 0.9));
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.topnav-links,
.topnav-utilities {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.topnav-utilities {
  flex: 0 0 auto;
}

.topnav a,
.topnav-dropdown-trigger {
  min-height: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.48rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: rgba(223, 233, 247, 0.82);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.topnav-link-label {
  white-space: nowrap;
}

.topnav-link-meta {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  background: rgba(72, 116, 188, 0.18);
  color: rgba(226, 239, 255, 0.82);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
}

.topnav a:hover,
.topnav a:focus-visible,
.topnav a[aria-current="page"],
.topnav-dropdown-trigger:hover,
.topnav-dropdown-trigger:focus-visible {
  color: var(--text);
  border-color: rgba(123, 154, 214, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.topnav a[aria-current="page"],
.topnav-dropdown-trigger[data-current="true"] {
  background: linear-gradient(180deg, rgba(232, 135, 49, 0.18), rgba(232, 135, 49, 0.08));
  border-color: rgba(232, 135, 49, 0.3);
  color: #ffd5a8;
  box-shadow: 0 10px 24px rgba(232, 135, 49, 0.14);
}

.topnav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-bottom: 0;
  margin-bottom: 0;
}

.topnav-dropdown::after,
.header-icon-menu::after,
.header-account-menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.6rem;
}

.topnav-caret {
  width: 0.48rem;
  height: 0.48rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.78;
}

.topnav-dropdown-menu {
  top: calc(100% + 0.18rem);
  min-width: 10.25rem;
  width: max-content;
  max-width: min(13rem, calc(100vw - 1.5rem));
  padding: 0.5rem;
  border-radius: 16px;
}

.header-icon-dropdown {
  top: calc(100% + 0.18rem);
}

.header-account-dropdown {
  top: calc(100% + 0.18rem);
}

.topnav-dropdown-menu a {
  justify-content: flex-start;
  width: 100%;
  padding: 0.52rem 0.7rem;
  text-transform: none;
  letter-spacing: 0.02em;
}

.topnav-status-link {
  border-color: rgba(96, 178, 132, 0.22);
  background: linear-gradient(180deg, rgba(26, 64, 47, 0.44), rgba(16, 34, 27, 0.2));
}

.topnav-status-link.is-online {
  border-color: rgba(96, 178, 132, 0.22);
  background: linear-gradient(180deg, rgba(26, 64, 47, 0.44), rgba(16, 34, 27, 0.2));
}

.topnav-status-link.is-offline,
.topnav-status-link.is-unavailable {
  border-color: rgba(196, 86, 86, 0.26);
  background: linear-gradient(180deg, rgba(82, 30, 30, 0.46), rgba(42, 17, 17, 0.24));
}

.topnav-status-link .topnav-link-label::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: #7ce59d;
  box-shadow: 0 0 12px rgba(124, 229, 157, 0.55);
  vertical-align: middle;
}

.topnav-premium-link {
  border-color: rgba(232, 135, 49, 0.42) !important;
  background: linear-gradient(180deg, rgba(232, 135, 49, 0.24), rgba(232, 135, 49, 0.1));
  color: #ffd8ad !important;
  box-shadow: 0 10px 24px rgba(232, 135, 49, 0.12);
}

.topnav-premium-link:hover,
.topnav-premium-link:focus-visible,
.topnav-premium-link[aria-current="page"] {
  border-color: rgba(232, 135, 49, 0.62) !important;
  background: linear-gradient(180deg, rgba(232, 135, 49, 0.34), rgba(232, 135, 49, 0.16));
  color: #fff0dc !important;
}

.topnav-status-link.is-offline .topnav-link-label::before,
.topnav-status-link.is-unavailable .topnav-link-label::before {
  background: #f07f7f;
  box-shadow: 0 0 12px rgba(240, 127, 127, 0.55);
}

.topnav-icon-link {
  width: 2.55rem;
  height: 2.55rem;
  padding: 0;
}

.topnav-icon-link svg {
  width: 1.9rem;
  height: 1.9rem;
}

.server-feed-shell {
  width: min(1380px, calc(100% - 1.5rem));
  margin: 1.2rem auto 2.2rem;
  display: grid;
  gap: 1rem;
}

.server-feed-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 20%, rgba(232, 135, 49, 0.16), transparent 26%),
    radial-gradient(circle at 16% 16%, rgba(97, 148, 255, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(9, 15, 28, 0.96), rgba(6, 11, 20, 0.94));
}

.server-feed-hero .page-hero-copy {
  max-width: min(60rem, 56%);
}

.server-feed-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7rem;
}

.server-feed-hero-actions {
  position: absolute;
  right: 1.35rem;
  bottom: 1.35rem;
  margin-top: 0;
}

.server-feed-hero-discord-btn {
  min-width: 11.5rem;
  justify-content: center;
}

.server-feed-grid {
  display: block;
}

.server-feed-gate-card {
  max-width: 44rem;
  margin-inline: auto;
  text-align: center;
}

.server-feed-gate-card .panel-header {
  justify-content: center;
}

.server-feed-gate-card .form-actions {
  justify-content: center;
}

.server-feed-panel {
  min-height: clamp(38rem, 74vh, 62rem);
  display: flex;
  flex-direction: column;
}

.server-feed-stream {
  min-height: 0;
  flex: 0 0 auto;
  display: flex;
  max-height: 48rem;
}

.server-feed-list {
  flex: 0 0 auto;
  width: 100%;
  min-height: 0;
  height: 48rem;
  max-height: 48rem;
  display: grid;
  align-content: start;
  gap: 0.8rem;
  overflow-y: auto;
  padding: 0.25rem 0.2rem 0 0;
}

.server-feed-item,
.server-feed-empty {
  padding: 1rem 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(113, 149, 212, 0.14);
  background: linear-gradient(180deg, rgba(15, 23, 39, 0.86), rgba(8, 14, 24, 0.92));
}

.server-feed-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  align-items: flex-start;
}

.server-feed-item-body {
  min-width: 0;
}

.server-feed-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.server-feed-item-headline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.server-feed-author-link {
  color: inherit;
  text-decoration: none;
}

.server-feed-author-link:hover,
.server-feed-author-link:focus-visible {
  color: rgba(255, 198, 121, 0.98);
}

.server-feed-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(232, 135, 49, 0.28);
  background:
    radial-gradient(circle at 28% 28%, rgba(255, 218, 171, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(232, 135, 49, 0.26), rgba(97, 148, 255, 0.16));
  color: rgba(255, 237, 213, 0.95);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.server-feed-avatar span {
  font-size: 0.88rem;
}

.server-feed-avatar.is-image {
  padding: 0;
  overflow: hidden;
  background: rgba(13, 20, 34, 0.92);
}

.server-feed-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.server-feed-source {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(232, 135, 49, 0.14);
  color: rgba(255, 211, 165, 0.92);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.server-feed-item p {
  margin: 0;
  color: rgba(231, 239, 251, 0.92);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.server-feed-composer {
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(113, 149, 212, 0.14);
  background:
    linear-gradient(180deg, rgba(6, 11, 20, 0), rgba(6, 11, 20, 0.78) 18%),
    transparent;
}

.server-feed-composer-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
}

.server-feed-composer-head h3 {
  margin: 0.15rem 0 0;
}

.server-feed-composer-tip {
  margin: 0;
  text-align: right;
}

.server-feed-cooldown-notice {
  margin: -0.1rem 0 0;
  min-height: 1.15rem;
  color: rgba(255, 207, 145, 0.92);
  opacity: 0;
  transform: translateY(-0.2rem);
  transition: opacity 160ms ease, transform 160ms ease;
}

.server-feed-cooldown-notice.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.server-feed-cooldown-notice.is-warning {
  color: rgba(255, 166, 137, 0.96);
}

.server-feed-form {
  display: grid;
  gap: 0.8rem;
}

.server-feed-form textarea {
  width: 100%;
  min-height: 6.5rem;
  max-height: 12rem;
  resize: vertical;
}

.server-feed-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.topbar-auth-btn {
  min-height: 2.7rem;
  padding-inline: 1rem;
  border-radius: 16px;
  border-color: rgba(232, 135, 49, 0.22);
  background: linear-gradient(180deg, rgba(232, 135, 49, 0.18), rgba(232, 135, 49, 0.08));
  box-shadow: 0 12px 26px rgba(232, 135, 49, 0.14);
}

.topbar-menu-toggle {
  display: none;
  width: 2.8rem;
  height: 2.8rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.3rem;
  border-radius: 14px;
  border: 1px solid rgba(98, 132, 190, 0.18);
  background: rgba(17, 24, 37, 0.88);
  cursor: pointer;
}

.topbar-menu-toggle span {
  width: 1.2rem;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 160ms ease, opacity 160ms ease;
}

.topbar.is-menu-open .topbar-menu-toggle span:nth-child(1) {
  transform: translateY(0.4rem) rotate(45deg);
}

.topbar.is-menu-open .topbar-menu-toggle span:nth-child(2) {
  opacity: 0;
}

.topbar.is-menu-open .topbar-menu-toggle span:nth-child(3) {
  transform: translateY(-0.4rem) rotate(-45deg);
}

.hero-card,
.panel {
  border-radius: 22px;
}

.hero-banner {
  min-height: 360px;
}

.hero-body {
  display: grid;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1.6rem;
  padding-right: min(34rem, 44vw);
  background: linear-gradient(180deg, rgba(4, 9, 18, 0.76), rgba(4, 9, 18, 0.88));
}

.hero-body h1 {
  max-width: none;
  white-space: nowrap;
  font-size: clamp(2.3rem, 4.3vw, 4.2rem);
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 56ch;
  margin: 0;
  font-size: 1.04rem;
  color: rgba(205, 218, 238, 0.84);
}

.hero-tracker-panel {
  right: 1.25rem;
  bottom: 1.25rem;
}

.hero-tracker-panel .tracker-card {
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(18, 25, 39, 0.94), rgba(8, 13, 24, 0.88)),
    rgba(9, 12, 11, 0.7);
}

.section-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.9fr);
  align-items: start;
}

.panel {
  padding: 1.3rem;
}

.panel-header {
  margin-bottom: 1rem;
}

.announcement-list,
.feature-cards {
  gap: 0.8rem;
}

.announcement-item,
.feature-card {
  border-radius: 18px;
  padding: 1rem 1.05rem;
}

.announcement-item h3 {
  font-size: 1.12rem;
}

.announcement-item p {
  font-size: 0.98rem;
}

.announcement-meta {
  font-size: 0.84rem;
}

.feature-cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-card {
  display: grid;
  gap: 0.75rem;
  align-content: start;
  background:
    radial-gradient(circle at top right, rgba(232, 135, 49, 0.08), transparent 44%),
    rgba(255, 255, 255, 0.025);
}

.feature-card p {
  margin: 0;
  font-size: 0.94rem;
}

.page-hero {
  padding: 1.35rem;
  background:
    radial-gradient(circle at 10% 10%, rgba(76, 122, 201, 0.12), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(232, 135, 49, 0.1), transparent 22%),
    linear-gradient(180deg, rgba(8, 13, 24, 0.98), rgba(7, 11, 20, 0.94));
}

.page-hero-split {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.page-hero-copy {
  display: grid;
  gap: 0.75rem;
  max-width: 52rem;
}

.page-hero-copy h1 {
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  letter-spacing: -0.04em;
}

.page-hero-actions {
  margin-top: 0.1rem;
}

.page-hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn {
  min-height: 2.85rem;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn-primary {
  box-shadow: 0 10px 24px rgba(232, 135, 49, 0.22);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
}

.btn-small {
  min-height: 2.35rem;
}

.footer {
  width: min(var(--page-max-width), calc(100% - 1.5rem));
  margin: 0 auto 2rem;
  padding: 1rem 1.2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer p {
  max-width: 72ch;
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    align-items: center;
    padding: 0.7rem;
  }

  .topbar-menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .topbar-actions {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-top: 0.65rem;
  }

  .topbar.is-menu-open .topbar-actions {
    display: flex;
  }

  .topnav {
    width: 100%;
  }

  .topnav-shell {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }

  .topnav-links,
  .topnav-utilities {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .topnav a,
  .topnav-dropdown,
  .topnav-dropdown-trigger,
  .header-account-menu,
  .topbar-auth-btn {
    width: 100%;
  }

  .topnav-dropdown-menu,
  .header-account-dropdown,
  .header-icon-dropdown {
    position: static;
    min-width: 0;
    max-height: none;
    margin-top: 0.35rem;
    box-shadow: none;
  }

  .topnav-dropdown::after,
  .header-icon-menu::after,
  .header-account-menu::after {
    display: none;
  }

  .topnav-dropdown-menu a {
    justify-content: center;
  }

  .topnav-icon-link {
    width: 100%;
    justify-content: center;
  }

  .hero-body {
    padding-right: 1.5rem;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  .hero-tracker-panel {
    position: static;
    width: auto;
    padding: 0 1.5rem 1.5rem;
  }

  .server-feed-meta {
    align-items: flex-start;
  }

  .server-feed-hero .page-hero-copy {
    max-width: none;
  }

  .server-feed-hero-actions {
    position: static;
    margin-top: 0.75rem;
  }

  .server-feed-panel {
    min-height: 0;
  }

  .server-feed-stream {
    max-height: 42rem;
  }

  .server-feed-list {
    height: 42rem;
    max-height: 42rem;
  }

  .server-feed-composer-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .server-feed-composer-tip {
    text-align: left;
  }

  .page-hero-split {
    flex-direction: column;
  }

  .page-hero-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .server-feed-shell {
    width: calc(100% - 1rem);
  }

  .server-feed-item {
    grid-template-columns: 1fr;
  }

  .server-feed-avatar {
    width: 2.7rem;
    height: 2.7rem;
  }

  .server-feed-stream {
    max-height: 34rem;
  }

  .server-feed-list {
    height: 34rem;
    max-height: 34rem;
  }
}

@media (max-width: 640px) {
  main,
  .topbar,
  .footer {
    width: min(var(--page-max-width), calc(100% - 1rem));
  }

  .hero-banner {
    min-height: 250px;
  }

  .hero-logo {
    top: 0.8rem;
    right: 0.8rem;
    max-width: 42vw;
    max-height: 82px;
  }

  .hero-body,
  .panel,
  .page-hero {
    padding: 1.1rem;
  }

  .hero-body h1,
  .page-hero-copy h1 {
    max-width: none;
    white-space: normal;
    font-size: 2rem;
  }

  .hero-actions,
  .page-hero-actions,
  .form-actions {
    flex-direction: column;
  }

  .hero-actions .btn,
  .page-hero-actions .btn,
  .form-actions .btn {
    width: 100%;
  }
}

html[data-theme="light"] {
  --bg-0: #fffaf8;
  --bg-1: #f8e8e6;
  --bg-2: #efd3d0;
  --panel: rgba(255, 248, 246, 0.96);
  --panel-2: rgba(252, 242, 240, 0.98);
  --border: rgba(145, 20, 39, 0.16);
  --text: #2f0f16;
  --muted: #7c3a45;
  --text-muted: #7c3a45;
  --accent: #9f102b;
  --accent-2: #bf1d3f;
  --good: #208457;
  --warn: #c46a10;
  --bad: #a61f2d;
  --shadow: 0 16px 36px rgba(126, 18, 38, 0.12);
  --scrollbar-thumb: rgba(232, 135, 49, 0.48);
  --scrollbar-thumb-hover: rgba(232, 135, 49, 0.68);
  --scrollbar-track: rgba(247, 234, 232, 0.95);
  --scrollbar-border: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] body {
  background: var(--bg-0);
}

html[data-theme="light"] .noise {
  opacity: 0.05;
  background-image:
    linear-gradient(rgba(215, 38, 72, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 107, 61, 0.04) 1px, transparent 1px);
}

html[data-theme="light"] .topbar,
html[data-theme="light"] .topnav-dropdown-menu,
html[data-theme="light"] .header-account-dropdown,
html[data-theme="light"] .header-icon-dropdown {
  border-color: rgba(145, 20, 39, 0.14);
  background: rgba(255, 249, 247, 0.96);
  box-shadow: 0 14px 28px rgba(126, 18, 38, 0.1);
}

html[data-theme="light"] .hero-card,
html[data-theme="light"] .panel,
html[data-theme="light"] .tracker-card,
html[data-theme="light"] .account-card,
html[data-theme="light"] .account-session-card,
html[data-theme="light"] .message-widget-launcher,
html[data-theme="light"] .groups-sidebar,
html[data-theme="light"] .groups-chat-column,
html[data-theme="light"] .groups-members-column,
html[data-theme="light"] .groups-chat-message,
html[data-theme="light"] .groups-member-item,
html[data-theme="light"] .chat-messages,
html[data-theme="light"] .chat-msg,
html[data-theme="light"] .profile-link-block,
html[data-theme="light"] .profile-social-item,
html[data-theme="light"] .forum-thread-list-item,
html[data-theme="light"] .forum-detail-body,
html[data-theme="light"] .statistics-summary-card,
html[data-theme="light"] .statistics-chart-card,
html[data-theme="light"] .statistics-table-wrap,
html[data-theme="light"] .statistics-map-sidepanel,
html[data-theme="light"] .message-widget,
html[data-theme="light"] .message-widget-body {
  border-color: rgba(145, 20, 39, 0.13);
  background: rgba(255, 250, 248, 0.92);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .hero-body {
  background: rgba(255, 247, 244, 0.84);
}

html[data-theme="light"] .brand-mark {
  box-shadow: 0 0 18px rgba(215, 38, 72, 0.28);
}

html[data-theme="light"] .topnav-shell {
  border-color: rgba(145, 20, 39, 0.12);
  background: linear-gradient(180deg, rgba(255, 252, 251, 0.96), rgba(255, 246, 243, 0.95));
}

html[data-theme="light"] .topnav a:hover,
html[data-theme="light"] .topnav a[aria-current="page"],
html[data-theme="light"] .topnav-dropdown-trigger:hover,
html[data-theme="light"] .topnav-dropdown-trigger:focus-visible,
html[data-theme="light"] .topnav-dropdown-trigger[data-current="true"],
html[data-theme="light"] .topnav-dropdown-menu a:hover,
html[data-theme="light"] .topnav-dropdown-menu a:focus-visible,
html[data-theme="light"] .header-account-dropdown a:hover,
html[data-theme="light"] .header-account-dropdown a:focus-visible,
html[data-theme="light"] .header-account-dropdown-action:hover,
html[data-theme="light"] .header-account-dropdown-action:focus-visible,
html[data-theme="light"] .header-notification-item:hover,
html[data-theme="light"] .header-notification-item:focus-visible {
  background: rgba(215, 38, 72, 0.08);
  color: var(--text);
}

html[data-theme="light"] .topbar-menu-toggle {
  border-color: rgba(145, 20, 39, 0.16);
  background: rgba(255, 253, 252, 0.96);
}

html[data-theme="light"] .topbar-menu-toggle span {
  background: var(--accent);
}

html[data-theme="light"] .page-hero {
  background:
    radial-gradient(circle at 10% 10%, rgba(159, 16, 43, 0.08), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(196, 106, 16, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(255, 248, 246, 0.98), rgba(252, 242, 240, 0.98));
}

html[data-theme="light"] .feature-card {
  border-color: rgba(145, 20, 39, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .topnav-icon-link,
html[data-theme="light"] .btn-secondary,
html[data-theme="light"] .header-notification-action-btn,
html[data-theme="light"] .groups-quick-create-btn,
html[data-theme="light"] .groups-sidebar-item,
html[data-theme="light"] .clan-tab-button,
html[data-theme="light"] .profile-link-icon,
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  border-color: rgba(145, 20, 39, 0.16);
  background: rgba(255, 253, 252, 0.96);
  color: var(--text);
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: rgba(139, 77, 86, 0.72);
}

html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] select:focus {
  outline: 2px solid rgba(215, 38, 72, 0.18);
  border-color: rgba(215, 38, 72, 0.4);
}

html[data-theme="light"] .btn-primary,
html[data-theme="light"] .theme-choice-btn.is-active {
  color: #fff5f3;
  border-color: rgba(120, 11, 31, 0.22);
  background: var(--accent);
}

html[data-theme="light"] .btn-secondary:hover,
html[data-theme="light"] .btn-secondary:focus-visible,
html[data-theme="light"] .topnav-icon-link:hover,
html[data-theme="light"] .topnav-icon-link:focus-visible,
html[data-theme="light"] .header-notification-action-btn:hover,
html[data-theme="light"] .header-notification-action-btn:focus-visible {
  border-color: rgba(159, 16, 43, 0.26);
  background: rgba(159, 16, 43, 0.08);
  color: var(--text);
}

html[data-theme="light"] .topnav-status-link {
  border-color: rgba(32, 132, 87, 0.22);
  background: rgba(32, 132, 87, 0.08);
}

html[data-theme="light"] .topnav-status-link.is-offline,
html[data-theme="light"] .topnav-status-link.is-unavailable {
  border-color: rgba(171, 52, 52, 0.22);
  background: rgba(171, 52, 52, 0.08);
}

html[data-theme="light"] .topbar-auth-btn {
  color: var(--accent);
  border-color: rgba(215, 38, 72, 0.18);
  background: linear-gradient(180deg, rgba(215, 38, 72, 0.12), rgba(255, 255, 255, 0.94));
}

html[data-theme="light"] .topbar-auth-btn:hover,
html[data-theme="light"] .topbar-auth-btn:focus-visible {
  background: linear-gradient(180deg, rgba(215, 38, 72, 0.18), rgba(255, 250, 249, 0.98));
}

html[data-theme="light"] .header-notification-delete-btn {
  background: rgba(215, 38, 72, 0.06);
  color: var(--muted);
}

html[data-theme="light"] .header-notification-delete-btn:hover,
html[data-theme="light"] .header-notification-delete-btn:focus-visible {
  background: rgba(215, 38, 72, 0.14);
}

html[data-theme="light"] .header-notification-item.is-unread,
html[data-theme="light"] .header-notification-action-btn.is-accept,
html[data-theme="light"] .feature-status.active {
  border-color: rgba(32, 132, 87, 0.22);
  background: rgba(32, 132, 87, 0.08);
}

html[data-theme="light"] .feature-status.planned {
  border-color: rgba(196, 106, 16, 0.18);
  background: rgba(196, 106, 16, 0.08);
}

html[data-theme="light"] .account-session-row,
html[data-theme="light"] .account-cta-block {
  border-color: rgba(191, 43, 63, 0.08);
}

html[data-theme="light"] .theme-switcher {
  border-color: rgba(145, 20, 39, 0.14);
  background: rgba(255, 248, 246, 0.92);
}

html[data-theme="light"] .theme-switcher-label {
  color: var(--accent);
}

html[data-theme="light"] .tracker-card {
  border-color: rgba(215, 38, 72, 0.16);
}

html[data-theme="light"] .message-widget-launcher {
  background:
    radial-gradient(circle at 14% 18%, rgba(159, 16, 43, 0.08), transparent 28%),
    rgba(255, 250, 248, 0.96);
}

html[data-theme="light"] .message-widget-launcher-meta {
  color: rgba(124, 58, 69, 0.88);
}

html[data-theme="light"] .groups-member-item.is-pending,
html[data-theme="light"] .chat-msg.user,
html[data-theme="light"] .clan-tab-button:hover,
html[data-theme="light"] .clan-tab-button.is-active,
html[data-theme="light"] .groups-sidebar-item:hover,
html[data-theme="light"] .groups-sidebar-item.is-active {
  border-color: rgba(159, 16, 43, 0.24);
  background: rgba(159, 16, 43, 0.08);
}

html[data-theme="light"] .chat-msg.staff {
  border-color: rgba(32, 132, 87, 0.22);
  background: rgba(32, 132, 87, 0.08);
}

html[data-theme="light"] .tracker-count,
html[data-theme="light"] .eyebrow,
html[data-theme="light"] .hero-stat-value,
html[data-theme="light"] .statistics-number-value {
  color: var(--accent);
}

.panel-client-guide {
  position: relative;
  overflow: hidden;
  padding: clamp(1.15rem, 2.2vw, 1.85rem);
  border-color: rgba(255, 179, 108, 0.28);
  background:
    linear-gradient(135deg, rgba(16, 27, 45, 0.96), rgba(9, 13, 23, 0.98) 52%, rgba(28, 19, 13, 0.94)),
    var(--panel-2);
}

.panel-client-guide::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 179, 108, 0.18), transparent 30%, rgba(126, 199, 255, 0.12) 72%, transparent),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 18px);
  opacity: 0.5;
}

.panel-client-guide::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-top: 1px solid rgba(255, 224, 190, 0.26);
}

.client-guide-main,
.client-guide-feature-row {
  position: relative;
  z-index: 1;
}

.client-guide-main {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(22rem, 0.98fr);
  gap: clamp(1rem, 2.2vw, 1.6rem);
  align-items: center;
  min-width: 0;
}

.client-guide-copy {
  display: grid;
  gap: 0.85rem;
  max-width: 64rem;
  min-width: 0;
}

.client-guide-copy h2 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.02;
  max-width: 12ch;
}

.client-guide-lede {
  margin: 0;
  max-width: 68ch;
  color: rgba(221, 232, 247, 0.86);
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.client-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.2rem;
}

.client-guide-showcase {
  display: grid;
  gap: 0.7rem;
  justify-items: stretch;
  min-width: 0;
}

.client-guide-screen {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(5, 9, 18, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 22px 54px rgba(0, 0, 0, 0.36);
}

.client-guide-screen-bar {
  display: flex;
  gap: 0.35rem;
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.client-guide-screen-bar span {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: rgba(255, 179, 108, 0.7);
}

.client-guide-screen-bar span:nth-child(2) {
  background: rgba(126, 199, 255, 0.7);
}

.client-guide-screen-bar span:nth-child(3) {
  background: rgba(136, 180, 102, 0.72);
}

.client-guide-screen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  padding: 0.86rem;
}

.client-guide-screen-grid div,
.client-guide-feature-row article {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.025);
}

.client-guide-screen-grid div {
  min-height: 7.3rem;
  display: grid;
  align-content: space-between;
  gap: 1rem;
  padding: 0.85rem;
  border-radius: 12px;
}

.client-guide-screen-grid span,
.client-guide-feature-row span {
  color: rgba(255, 179, 108, 0.92);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.client-guide-screen-grid strong {
  color: var(--text);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.18;
}

.client-guide-feature-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.client-guide-feature-row article {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  min-height: 11rem;
  padding: 1rem;
  border-radius: 14px;
}

.client-guide-feature-row article:nth-child(3) {
  border-color: rgba(232, 135, 49, 0.72);
  box-shadow:
    0 0 0 1px rgba(232, 135, 49, 0.16),
    0 0 24px rgba(232, 135, 49, 0.14),
    inset 0 1px 0 rgba(255, 179, 108, 0.1);
  animation: clientGuideOverlayPulse 2.6s ease-in-out infinite;
}

.client-guide-feature-row h3 {
  font-size: 1.1rem;
}

.client-guide-feature-row p {
  margin: 0;
  color: rgba(185, 199, 220, 0.86);
  line-height: 1.5;
}

html[data-theme="light"] .panel-client-guide {
  border-color: rgba(159, 16, 43, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 250, 248, 0.98), rgba(251, 239, 235, 0.98) 52%, rgba(255, 245, 236, 0.97)),
    var(--panel-2);
}

html[data-theme="light"] .panel-client-guide::before {
  background:
    linear-gradient(90deg, rgba(159, 16, 43, 0.1), transparent 32%, rgba(196, 106, 16, 0.12) 72%, transparent),
    repeating-linear-gradient(135deg, rgba(159, 16, 43, 0.045) 0 1px, transparent 1px 18px);
}

html[data-theme="light"] .client-guide-lede,
html[data-theme="light"] .client-guide-feature-row p {
  color: rgba(89, 45, 52, 0.82);
}

html[data-theme="light"] .client-guide-screen,
html[data-theme="light"] .client-guide-screen-grid div,
html[data-theme="light"] .client-guide-feature-row article {
  border-color: rgba(145, 20, 39, 0.13);
  background: rgba(255, 255, 255, 0.58);
}

html[data-theme="light"] .client-guide-screen-grid strong {
  color: var(--text);
}

html[data-theme="light"] .client-guide-feature-row article:nth-child(3) {
  border-color: rgba(159, 16, 43, 0.5);
  box-shadow:
    0 0 0 1px rgba(159, 16, 43, 0.1),
    0 0 22px rgba(196, 106, 16, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

@keyframes clientGuideOverlayPulse {
  0%,
  100% {
    border-color: rgba(232, 135, 49, 0.58);
    box-shadow:
      0 0 0 1px rgba(232, 135, 49, 0.12),
      0 0 18px rgba(232, 135, 49, 0.1),
      inset 0 1px 0 rgba(255, 179, 108, 0.08);
  }
  50% {
    border-color: rgba(255, 179, 108, 0.95);
    box-shadow:
      0 0 0 1px rgba(255, 179, 108, 0.22),
      0 0 34px rgba(232, 135, 49, 0.28),
      inset 0 1px 0 rgba(255, 179, 108, 0.18);
  }
}

@media (max-width: 980px) {
  .client-guide-main,
  .client-guide-feature-row {
    grid-template-columns: 1fr;
  }

  .client-guide-copy h2 {
    max-width: 16ch;
  }

  .client-guide-badge {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .panel-client-guide {
    max-width: calc(100vw - 1rem);
  }

  .client-guide-copy,
  .client-guide-showcase,
  .client-guide-screen,
  .client-guide-feature-row {
    max-width: calc(100vw - 3.2rem);
  }

  .client-guide-screen-grid {
    grid-template-columns: 1fr;
  }

  .client-guide-copy h2 {
    max-width: 12ch;
    font-size: 1.7rem;
    overflow-wrap: anywhere;
  }

  .client-guide-lede {
    max-width: 30ch;
  }

  .client-guide-actions {
    width: min(100%, calc(100vw - 4rem));
  }

  .client-guide-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .client-guide-feature-row article,
  .client-guide-screen-grid div {
    min-height: auto;
  }
}

.client-guide-doc {
  gap: 1rem;
  margin-top: 0.25rem;
}

.client-guide-doc-hero {
  position: relative;
  min-height: min(62vh, 42rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(24rem, 0.82fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  overflow: hidden;
  margin-top: 0.35rem;
  padding: clamp(0.35rem, 1.1vw, 0.75rem) clamp(1.25rem, 3vw, 2.4rem) clamp(1.15rem, 2.5vw, 1.9rem);
  border-radius: 18px;
  border: 1px solid rgba(255, 179, 108, 0.24);
  background:
    linear-gradient(180deg, rgba(4, 8, 15, 0.14), rgba(4, 8, 15, 0.86)),
    linear-gradient(90deg, rgba(4, 8, 15, 0.92), rgba(4, 8, 15, 0.42) 52%, rgba(4, 8, 15, 0.82)),
    url("/web-images/braai_master_banner_v2.webp"),
    linear-gradient(135deg, #080e19, #150e09);
  background-size: cover, cover, cover, cover;
  background-position: center, center, center -4.5rem, center;
  box-shadow: var(--shadow);
}

.client-guide-doc-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 179, 108, 0.16), transparent 34%, rgba(126, 199, 255, 0.1) 74%, transparent),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 20px);
}

.client-guide-doc-hero-copy,
.client-guide-doc-visual {
  position: relative;
  z-index: 1;
}

.client-guide-doc-hero-copy {
  display: grid;
  gap: 0.95rem;
  max-width: 58rem;
  align-self: center;
}

.client-guide-doc-kicker {
  width: max-content;
  margin: 0;
  padding: 0.35rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 179, 108, 0.28);
  background: rgba(232, 135, 49, 0.14);
  color: rgba(255, 219, 182, 0.96);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.client-guide-doc-hero h1 {
  max-width: 10ch;
  font-size: clamp(2.6rem, 6vw, 6.4rem);
  line-height: 0.98;
}

.client-guide-doc-hero p {
  max-width: 68ch;
  margin: 0;
  color: rgba(224, 235, 250, 0.9);
  font-size: clamp(1.02rem, 1.45vw, 1.24rem);
  line-height: 1.62;
}

.client-guide-doc-actions,
.client-guide-doc-actions-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.client-guide-doc-visual {
  display: grid;
  justify-items: end;
  gap: 1rem;
  align-self: center;
  min-width: 0;
}

.client-guide-doc-logo-shell {
  display: grid;
  place-items: center;
  justify-self: end;
  animation: heroLogoFloat 6s ease-in-out infinite;
}

.client-guide-doc-logo-shell .hero-logo-ring {
  width: clamp(5.8rem, 10vw, 7.2rem);
  height: clamp(5.8rem, 10vw, 7.2rem);
}

.client-guide-doc-logo-image {
  transform: translateY(-1px) scale(1.34);
  transform-origin: center;
}

.client-guide-doc-window {
  width: min(100%, 34rem);
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(5, 9, 18, 0.86);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
}

.client-guide-doc-window-bar {
  display: flex;
  gap: 0.36rem;
  padding: 0.78rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.client-guide-doc-window-bar span {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: rgba(255, 179, 108, 0.72);
}

.client-guide-doc-window-bar span:nth-child(2) {
  background: rgba(126, 199, 255, 0.72);
}

.client-guide-doc-window-bar span:nth-child(3) {
  background: rgba(136, 180, 102, 0.72);
}

.client-guide-doc-window-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  padding: 0.9rem;
}

.client-guide-doc-window-body div {
  min-height: 7rem;
  display: grid;
  align-content: space-between;
  gap: 1rem;
  padding: 0.86rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(232, 135, 49, 0.08), transparent 44%),
    rgba(255, 255, 255, 0.03);
}

.client-guide-doc-window-body span,
.client-guide-doc-feature-grid span,
.client-guide-doc-section-head > span {
  color: rgba(255, 179, 108, 0.94);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.client-guide-doc-window-body strong {
  font-size: 1.08rem;
  line-height: 1.18;
}

.client-guide-doc-nav {
  position: sticky;
  top: 0.5rem;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.55rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 179, 108, 0.18);
  background: rgba(5, 9, 18, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.client-guide-doc-nav a {
  color: rgba(226, 236, 250, 0.86);
  text-decoration: none;
  padding: 0.52rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.client-guide-doc-nav a:hover,
.client-guide-doc-nav a:focus-visible {
  color: var(--text);
  border-color: rgba(255, 179, 108, 0.24);
  background: rgba(232, 135, 49, 0.1);
}

.client-guide-doc-section,
.client-guide-doc-band {
  display: grid;
  gap: 1rem;
  padding: clamp(1.1rem, 2.2vw, 1.7rem);
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  box-shadow: var(--shadow);
}

.client-guide-doc-section-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.client-guide-doc-section-head > span {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 179, 108, 0.24);
  background: rgba(232, 135, 49, 0.12);
}

.client-guide-doc-section-head h2,
.client-guide-doc-band-copy h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.client-guide-doc-section-head p,
.client-guide-doc-band-copy p {
  max-width: 74ch;
  margin: 0.45rem 0 0;
  color: rgba(188, 203, 225, 0.86);
  line-height: 1.58;
}

.client-guide-doc-steps,
.client-guide-doc-feature-grid,
.client-guide-doc-callouts {
  display: grid;
  gap: 0.8rem;
}

.client-guide-doc-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-guide-doc-feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.client-guide-doc-steps article,
.client-guide-doc-feature-grid article,
.client-guide-doc-callouts article,
.client-guide-doc-timeline article,
.client-guide-doc-module-list div,
.client-guide-doc-copy-block,
.client-guide-doc-faq details {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(232, 135, 49, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.025);
}

.client-guide-doc-steps article,
.client-guide-doc-feature-grid article,
.client-guide-doc-callouts article {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  min-height: 11.5rem;
  padding: 1rem;
}

.client-guide-doc-steps strong,
.client-guide-doc-feature-grid h3,
.client-guide-doc-callouts strong,
.client-guide-doc-timeline span,
.client-guide-doc-module-list strong,
.client-guide-doc-copy-block h3 {
  color: var(--text);
  font-size: 1.08rem;
}

.client-guide-doc-steps p,
.client-guide-doc-feature-grid p,
.client-guide-doc-callouts span,
.client-guide-doc-timeline p,
.client-guide-doc-module-list span,
.client-guide-doc-copy-block p,
.client-guide-doc-faq p {
  margin: 0;
  color: rgba(188, 203, 225, 0.84);
  line-height: 1.52;
}

.client-guide-doc-band {
  border-color: rgba(255, 179, 108, 0.2);
  background:
    linear-gradient(135deg, rgba(16, 27, 45, 0.96), rgba(9, 13, 23, 0.98) 56%, rgba(28, 19, 13, 0.94)),
    var(--panel-2);
}

.client-guide-doc-band-strong {
  border-color: rgba(232, 135, 49, 0.38);
  background:
    linear-gradient(135deg, rgba(39, 24, 12, 0.96), rgba(8, 14, 26, 0.98) 48%, rgba(11, 31, 39, 0.92)),
    var(--panel-2);
}

.client-guide-doc-split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(22rem, 1.15fr);
  gap: 0.9rem;
  align-items: stretch;
}

.client-guide-doc-copy-block,
.client-guide-doc-module-list div {
  padding: 1rem;
}

.client-guide-doc-copy-block {
  display: grid;
  gap: 0.8rem;
}

.client-guide-doc-module-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.client-guide-doc-module-list div {
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.client-guide-doc-timeline {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-guide-doc-timeline article {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
}

.faq-group-title {
  margin: 1.6rem 0 0.55rem;
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 179, 108, 0.92);
}

.faq-group-title:first-of-type {
  margin-top: 0.85rem;
}

.client-guide-doc-faq {
  display: grid;
  gap: 0.7rem;
}

.client-guide-doc-faq details {
  padding: 0.95rem 1rem;
}

.client-guide-doc-faq summary {
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.client-guide-doc-faq p {
  padding-top: 0.65rem;
}

.client-guide-doc-actions-bottom {
  margin-top: 0.25rem;
}

html[data-theme="light"] .client-guide-doc-hero,
html[data-theme="light"] .client-guide-doc-section,
html[data-theme="light"] .client-guide-doc-band {
  border-color: rgba(145, 20, 39, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 250, 248, 0.84), rgba(252, 242, 240, 0.94)),
    var(--panel-2);
}

html[data-theme="light"] .client-guide-doc-nav,
html[data-theme="light"] .client-guide-doc-window,
html[data-theme="light"] .client-guide-doc-steps article,
html[data-theme="light"] .client-guide-doc-feature-grid article,
html[data-theme="light"] .client-guide-doc-callouts article,
html[data-theme="light"] .client-guide-doc-timeline article,
html[data-theme="light"] .client-guide-doc-module-list div,
html[data-theme="light"] .client-guide-doc-copy-block,
html[data-theme="light"] .client-guide-doc-faq details {
  border-color: rgba(145, 20, 39, 0.13);
  background: rgba(255, 255, 255, 0.62);
}

html[data-theme="light"] .client-guide-doc-hero p,
html[data-theme="light"] .client-guide-doc-section-head p,
html[data-theme="light"] .client-guide-doc-band-copy p,
html[data-theme="light"] .client-guide-doc-steps p,
html[data-theme="light"] .client-guide-doc-feature-grid p,
html[data-theme="light"] .client-guide-doc-callouts span,
html[data-theme="light"] .client-guide-doc-timeline p,
html[data-theme="light"] .client-guide-doc-module-list span,
html[data-theme="light"] .client-guide-doc-copy-block p,
html[data-theme="light"] .client-guide-doc-faq p {
  color: rgba(89, 45, 52, 0.82);
}

@media (max-width: 1100px) {
  .client-guide-doc-hero,
  .client-guide-doc-split {
    grid-template-columns: 1fr;
  }

  .client-guide-doc-visual {
    justify-items: start;
  }

  .client-guide-doc-steps,
  .client-guide-doc-feature-grid,
  .client-guide-doc-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .client-guide-doc {
    width: calc(100vw - 1rem);
    max-width: calc(100vw - 1rem);
    overflow-x: hidden;
  }

  .client-guide-doc-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    padding: 1rem;
  }

  .client-guide-doc-hero h1 {
    max-width: 11ch;
    font-size: 2.65rem;
  }

  .client-guide-doc-hero p,
  .client-guide-doc-section-head p,
  .client-guide-doc-band-copy p,
  .client-guide-doc-steps p,
  .client-guide-doc-feature-grid p,
  .client-guide-doc-callouts span,
  .client-guide-doc-timeline p,
  .client-guide-doc-module-list span,
  .client-guide-doc-copy-block p,
  .client-guide-doc-faq p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .client-guide-doc-actions .btn,
  .client-guide-doc-actions-bottom .btn {
    width: 100%;
    justify-content: center;
  }

  .client-guide-doc-nav,
  .client-guide-doc-section,
  .client-guide-doc-band,
  .client-guide-doc-visual,
  .client-guide-doc-window {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .client-guide-doc-nav a {
    flex: 1 1 auto;
    text-align: center;
  }

  .client-guide-doc-window-body,
  .client-guide-doc-steps,
  .client-guide-doc-feature-grid,
  .client-guide-doc-module-list,
  .client-guide-doc-timeline {
    grid-template-columns: 1fr;
  }

  .client-guide-doc-nav {
    position: relative;
    top: auto;
  }
}

.btn {
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  transition: transform 140ms ease, opacity 140ms ease, border-color 140ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.hero-card,
.panel,
.feature-card,
.community-summary-card,
.server-feed-item,
.server-feed-empty,
.topnav-shell,
.header-icon-dropdown,
.header-account-dropdown,
.topnav-dropdown-menu {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 220ms ease, background 220ms ease;
}

.hero-card:hover,
.panel:hover,
.feature-card:hover,
.feature-card:focus-within,
.community-summary-card:hover,
.server-feed-item:hover {
  border-color: rgba(255, 179, 108, 0.3);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.28);
}

.feature-card:hover,
.feature-card:focus-within,
.community-summary-card:hover,
.server-feed-item:hover {
  transform: translateY(-4px);
}

.topnav-shell:hover,
.header-icon-dropdown:hover,
.header-account-dropdown:hover,
.topnav-dropdown-menu:hover {
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.32);
}

.topnav-icon-link {
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.topnav-icon-link:hover,
.topnav-icon-link:focus-visible {
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
}

.statistics-tab-button,
.clan-tab-button,
.groups-sidebar-item,
.forum-thread-list-item,
.forum-mod-queue-item,
.forum-mod-log-item,
.profile-social-item,
.group-picker-dialog .profile-social-list > *,
.statistics-map-sidepanel-tab {
  transition: transform 160ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.statistics-tab-button:hover,
.statistics-tab-button:focus-visible,
.clan-tab-button:hover,
.clan-tab-button:focus-visible,
.groups-sidebar-item:hover,
.groups-sidebar-item:focus-visible,
.forum-thread-list-item:hover,
.forum-thread-list-item:focus-visible,
.profile-social-item:hover,
.profile-social-item:focus-within,
.statistics-map-sidepanel-tab:hover,
.statistics-map-sidepanel-tab:focus-visible {
  transform: translateY(-2px);
}

main > .hero-card,
main > .panel,
main > section.panel,
main > section.hero-card {
  animation: pageSectionRise 420ms ease both;
}

main > *:nth-child(2) {
  animation-delay: 50ms;
}

main > *:nth-child(3) {
  animation-delay: 100ms;
}

main > *:nth-child(4) {
  animation-delay: 150ms;
}

@keyframes pageSectionRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  body {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}

.clan-browser-shell {
  gap: 1.5rem;
}

.clan-browser-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(224, 135, 55, 0.28);
  background:
    radial-gradient(circle at top right, rgba(224, 135, 55, 0.18), transparent 36%),
    linear-gradient(145deg, rgba(29, 20, 14, 0.94), rgba(17, 13, 10, 0.98));
}

.clan-browser-hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -38% auto;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224, 135, 55, 0.16), transparent 68%);
  pointer-events: none;
}

.clan-browser-main,
.clan-browser-side,
.clan-browser-spotlight,
.clan-browser-owned-panel,
.clan-roster-panel,
.clan-workspace-shell > .statistics-tabbar,
.clan-info-grid > .panel,
.clan-news-grid > .panel,
.clan-roster-grid > .panel,
.clan-management-grid > .panel {
  border: 1px solid rgba(224, 135, 55, 0.18);
  background:
    linear-gradient(180deg, rgba(32, 23, 18, 0.96), rgba(17, 13, 10, 0.98));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.clan-browser-owned-panel,
.clan-roster-panel,
.clan-management-grid,
.clan-news-grid,
.clan-info-grid,
.clan-roster-grid {
  display: grid;
  gap: 1rem;
}

/* BM-268 custom clan roles: clickable role list + editor popup. */
.clan-roles-section {
  display: grid;
  gap: 0.55rem;
}

.clan-roles-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.clan-roles-title {
  margin: 0;
  font-size: 1.02rem;
}

.clan-roles-add-btn {
  background: rgba(232, 135, 49, 0.12);
  border-color: rgba(232, 135, 49, 0.5);
  color: var(--accent-2);
  font-weight: 600;
}

.clan-roles-add-btn:hover {
  background: rgba(232, 135, 49, 0.2);
  border-color: var(--accent);
}

.clan-roles-list {
  display: grid;
  gap: 0.5rem;
}

.clan-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(76, 110, 163, 0.2);
  background: rgba(13, 20, 33, 0.85);
  color: var(--text);
  font: inherit;
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease;
}

.clan-role-row:hover,
.clan-role-row:focus-visible {
  border-color: rgba(232, 135, 49, 0.45);
  background: rgba(232, 135, 49, 0.07);
  outline: none;
  transform: translateY(-1px);
}

.clan-role-row-main {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.clan-role-row-name {
  font-weight: 700;
}

.clan-role-row-perms {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clan-role-row-edit {
  flex: none;
  font-size: 0.78rem;
  color: var(--accent-2);
  opacity: 0.85;
}

.clan-role-dialog {
  max-width: 26rem;
}

.clan-role-perms {
  border: 1px solid rgba(76, 110, 163, 0.2);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.clan-role-perms legend {
  padding: 0 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.clan-role-perm {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  margin: 0;
}

.clan-role-perm input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

.clan-role-perm input[type="checkbox"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.clan-role-owner-note {
  margin: 0;
  color: var(--accent-2);
}

.clan-role-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.clan-manage-members-list {
  display: grid;
  gap: 0.5rem;
}

.clan-manage-member-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(76, 110, 163, 0.2);
  background: rgba(13, 20, 33, 0.85);
}

.clan-manage-member-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clan-manage-member-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.clan-manage-member-rolelabel {
  white-space: nowrap;
}

.clan-manage-member-row .clan-member-role-select {
  min-height: 2.4rem;
  width: auto;
  min-width: 7.5rem;
  max-width: 11rem;
  flex: none;
}

/* Clan roster rows: member avatar on the left, details on the right. */
.clan-roster-member {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.clan-roster-member-body {
  flex: 1 1 auto;
  min-width: 0;
}

.clan-roster-avatar-link {
  flex: none;
  display: block;
  border-radius: 12px;
  line-height: 0;
}

.clan-roster-avatar {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.clan-roster-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  background: linear-gradient(135deg, rgba(232, 135, 49, 0.32), rgba(232, 135, 49, 0.12));
}

.clan-roster-avatar-link:hover .clan-roster-avatar,
.clan-roster-avatar-link:focus-visible .clan-roster-avatar {
  border-color: rgba(232, 135, 49, 0.5);
}

.clan-browser-owned-panel > .panel-header {
  margin-bottom: 0;
}

.clan-browser-side-empty {
  min-height: 16rem;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.clan-browser-side-empty .form-actions {
  justify-content: center;
}

.clan-browser-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: end;
  margin-bottom: 1rem;
}

.clan-browser-filter {
  display: grid;
  gap: 0.45rem;
}

.clan-browser-filter-actions {
  justify-content: flex-start;
}

.clan-browser-list,
.clan-browser-your-clans {
  display: grid;
  gap: 0.95rem;
}

.clan-browser-card,
.clan-browser-owned-card,
.clan-browser-owned-square {
  position: relative;
  display: grid;
  gap: 0.9rem;
  border-radius: 18px;
  border: 1px solid rgba(224, 135, 55, 0.14);
  background:
    linear-gradient(140deg, rgba(40, 28, 21, 0.92), rgba(22, 16, 12, 0.96));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.clan-browser-card:hover,
.clan-browser-card:focus-within,
.clan-browser-owned-card:hover,
.clan-browser-owned-card:focus-visible,
.clan-browser-owned-square:hover,
.clan-browser-owned-square:focus-visible {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(224, 135, 55, 0.38);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
}

.clan-browser-card.is-selected {
  border-color: rgba(224, 135, 55, 0.46);
  box-shadow: 0 0 0 1px rgba(224, 135, 55, 0.25), 0 24px 48px rgba(0, 0, 0, 0.32);
}

.clan-browser-card-main,
.clan-browser-owned-card {
  color: inherit;
  text-decoration: none;
  padding: 1.05rem 1.1rem 0;
}

.clan-browser-owned-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3.25rem) / 6);
  gap: 0.65rem;
  overflow-x: auto;
  /* overflow-x:auto forces vertical clipping too, so leave room top + bottom
     for the cards' hover lift (translateY) — otherwise the lifted top edge of
     a card gets clipped by the rail. */
  padding-top: 0.5rem;
  padding-bottom: 0.4rem;
  scroll-snap-type: x proximity;
}

.clan-browser-owned-square {
  aspect-ratio: 1 / 1;
  min-width: 0;
  gap: 0.45rem;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0.56rem 0.42rem 0.62rem;
  place-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  scroll-snap-align: start;
  /* Clip so a large logo can never spill past the rounded border (and the
     middle row collapses cleanly at narrow widths instead of overlapping the
     name/member-count rows). */
  overflow: hidden;
}

.clan-browser-owned-square-name,
.clan-browser-owned-square-count {
  display: grid;
  place-items: center;
  font-weight: 600;
}

.clan-browser-owned-square-name {
  align-self: start;
  width: 100%;
  font-size: var(--owned-clan-name-size, 1rem);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clan-browser-owned-square-logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  /* Flexible middle row — must be allowed to shrink so the logo (positioned
     below) scales down to fit small tiles rather than forcing the card taller. */
  min-height: 0;
}

/* The logo is absolutely centered inside its (clipped) cell so it stays a
   square that scales to the largest size that fits — it can never overlap the
   clan name above it or the member-count below it, at any tile width. */
.clan-browser-owned-logo {
  position: absolute;
  inset: 0;
  margin: auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.clan-browser-owned-logo-fallback {
  position: absolute;
  inset: 0;
  margin: auto;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  max-width: 6.55rem;
  max-height: 6.55rem;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 225, 191, 0.92);
  background: linear-gradient(135deg, rgba(112, 71, 35, 0.68), rgba(58, 36, 22, 0.92));
}

.clan-browser-card-actions,
.clan-browser-side-actions {
  padding: 0 1.1rem 1.05rem;
}

.clan-browser-card-brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.clan-browser-card-logo {
  width: 4rem;
  height: 4rem;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.clan-browser-card-logo-fallback {
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 225, 191, 0.92);
  background: linear-gradient(135deg, rgba(112, 71, 35, 0.68), rgba(58, 36, 22, 0.92));
}

.clan-browser-card-title-row,
.clan-browser-owned-head,
.clan-browser-owned-meta,
.clan-browser-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  align-items: center;
}

.clan-browser-card-title-row h3,
.clan-browser-owned-head strong {
  margin: 0;
}

.clan-browser-card-stats {
  padding: 0 1.1rem;
  color: rgba(239, 228, 214, 0.8);
}

.clan-browser-card-stats span,
.clan-browser-owned-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
}

.clan-browser-owned-card {
  padding: 1rem 1.05rem;
}

.clan-browser-side-empty {
  display: grid;
  gap: 1rem;
}

.clan-info-grid,
.clan-news-grid,
.clan-management-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.clan-info-grid {
  grid-template-columns: minmax(0, 1fr);
}

.clan-roster-grid {
  grid-template-columns: minmax(0, 1fr);
}

.clan-workspace-shell {
  margin-bottom: 1rem;
}

.clan-workspace-tabbar {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.2rem;
  flex-wrap: nowrap;
}

.clan-workspace-tabbar .statistics-tab-button {
  min-width: 0;
  min-height: 2.95rem;
  padding: 0.72rem 0.55rem 0.68rem;
  font-size: 0.9rem;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.clan-roster-panel .clan-browser-list {
  margin-top: 0.75rem;
}

@media (max-width: 980px) {
  .clan-browser-filters,
  .clan-info-grid,
  .clan-news-grid,
  .clan-management-grid {
    grid-template-columns: 1fr;
  }

  .clan-browser-owned-rail {
    grid-auto-columns: minmax(13rem, 70vw);
  }

  .clan-workspace-tabbar .statistics-tab-button {
    font-size: 0.82rem;
    padding-inline: 0.35rem;
  }
}

/* ===================================================================== */
/* Server Status page (server-status.html / server-status.js, BM-159)    */
/* ===================================================================== */
.server-status-shell {
  width: min(var(--page-max-width), calc(100% - 1.5rem));
  margin: 0.9rem auto 2.5rem;
  display: grid;
  gap: 1rem;
}

.server-status-shell .section-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.server-status-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 1.6rem;
}

.server-status-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin: 0.15rem 0 0.4rem;
}

.server-status-intro {
  margin: 0;
  color: var(--muted);
  max-width: 46ch;
}

.server-status-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  white-space: nowrap;
}

.server-status-error {
  margin: 0;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 110, 110, 0.34);
  background: rgba(120, 22, 22, 0.18);
  color: #ffb4b4;
}

/* Live status banner */
.server-status-banner {
  display: grid;
  gap: 1.2rem;
  padding: 1.4rem 1.6rem;
}

.server-status-banner-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.server-status-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(133, 148, 173, 0.16);
  flex: none;
}

.server-status-dot[data-state="online"] {
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18), 0 0 14px rgba(74, 222, 128, 0.55);
}

.server-status-dot[data-state="offline"] {
  background: #f87171;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.16);
}

.server-status-dot[data-state="unknown"] {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(255, 179, 108, 0.16);
}

.server-status-state {
  display: block;
  font-size: 1.35rem;
  color: var(--text);
}

.server-status-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.server-status-stat {
  display: grid;
  gap: 0.25rem;
  align-content: start;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(7, 12, 22, 0.55);
}

.server-status-stat strong {
  font-size: 1.7rem;
  color: var(--text);
  line-height: 1.1;
}

.server-status-stat p {
  margin: 0;
}

.server-status-capacity-rail {
  margin-top: 0.35rem;
  height: 6px;
  border-radius: 999px;
  background: rgba(133, 148, 173, 0.2);
  overflow: hidden;
}

.server-status-capacity-rail span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}

/* Player activity timeline */
.server-status-chart-card {
  padding: 1.4rem 1.6rem;
  display: grid;
  gap: 1rem;
}

.server-status-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.server-status-chart-head h2 {
  font-size: 1.3rem;
  margin: 0.15rem 0 0.25rem;
}

.server-status-chart-head p {
  margin: 0;
}

.server-status-summary {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.server-status-summary-item strong {
  display: block;
  font-size: 1.4rem;
  color: var(--text);
}

.server-status-zoom {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(7, 12, 22, 0.6);
}

.server-status-zoom button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.server-status-zoom button:hover {
  color: var(--text);
}

.server-status-zoom button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a0f04;
}

.server-status-chart-wrap {
  position: relative;
  width: 100%;
}

.server-status-chart-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 14px;
}

.ss-chart {
  width: 100%;
  height: auto;
  display: block;
}

.ss-grid-line {
  stroke: rgba(133, 148, 173, 0.16);
  stroke-width: 1;
}

.ss-axis-label {
  fill: var(--muted);
  font-size: 11px;
}

.ss-area {
  fill: url(#ssArea);
  stroke: none;
}

.ss-line {
  fill: none;
  stroke: url(#ssLine);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.ss-hover-line {
  stroke: rgba(255, 179, 108, 0.6);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.ss-hover-dot {
  fill: var(--accent-2);
  stroke: #1a0f04;
  stroke-width: 2;
}

.ss-hover-capture {
  cursor: crosshair;
}

.ss-tooltip {
  position: absolute;
  top: 6px;
  transform: translateX(-50%);
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  background: rgba(3, 6, 12, 0.94);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

.server-status-chart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Wipe & map + connect grid */
.server-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.server-status-map-card,
.server-status-connect-card {
  padding: 1.4rem 1.6rem;
  display: grid;
  gap: 1.1rem;
  align-content: start;
}

.server-status-card-head h2 {
  font-size: 1.25rem;
  margin: 0.2rem 0 0;
}

.server-status-map-body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
}

.server-status-map-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(7, 12, 22, 0.6);
  display: grid;
  place-items: center;
}

.server-status-map-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.server-status-meta-list {
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.server-status-meta-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid rgba(133, 148, 173, 0.12);
  padding-bottom: 0.55rem;
}

.server-status-meta-list > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.server-status-meta-list dt {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.server-status-meta-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.server-status-map-link {
  justify-self: start;
}

.server-status-connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.server-status-connect-note {
  margin: 0;
}

@media (max-width: 860px) {
  .server-status-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .server-status-grid {
    grid-template-columns: 1fr;
  }
  .server-status-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .server-status-header-actions {
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .server-status-stat-grid {
    grid-template-columns: 1fr;
  }
  .server-status-map-body {
    grid-template-columns: 1fr;
  }
}

/* =====================================================================
   BM-192 — Personal surfaces refresh: Profile / Account (settings) /
   Sign-In. Direction: refined & cohesive. Narrower reading width, tighter
   rhythm, unified card chrome, clearer hierarchy, subtle motion. All rules
   are scoped to the page shells (.profile-shell / .settings-shell /
   .account-page-shell) so no other surface is affected, and stay
   theme-agnostic (token-based) so dark + light both hold up.
   ===================================================================== */

/* --- Shared: reading width + vertical rhythm ------------------------- */
.profile-shell,
.settings-shell {
  width: min(1120px, calc(100% - 1.5rem));
  gap: 0.8rem;
}

.account-page-shell {
  /* A focused, centred single-column auth experience. */
  width: min(560px, calc(100% - 1.5rem));
  gap: 0.8rem;
}

/* Softer, grouped shadow so stacked panels read as one cohesive space
   rather than floating far apart (the global --shadow is intentionally
   heavy for hero cards). */
.profile-shell > .panel,
.profile-grid > .panel,
.settings-shell > .panel,
.settings-col > .panel,
.account-page-shell > .panel {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.30);
}

/* Unified section-heading motif: a small ember tick replaces the (globally
   hidden) eyebrow label so each card reads as deliberately titled. */
.profile-shell .panel > .panel-header h2,
.settings-shell .panel > .panel-header h2,
.account-page-shell .panel > .panel-header h2 {
  position: relative;
  padding-left: 0.7rem;
}
.profile-shell .panel > .panel-header h2::before,
.settings-shell .panel > .panel-header h2::before,
.account-page-shell .panel > .panel-header h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.12em;
  bottom: 0.12em;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}

/* --- Profile: hero --------------------------------------------------- */
.profile-shell .profile-hero {
  padding: 1.6rem 1.7rem;
  gap: 1.15rem 1.6rem;
}

.profile-shell .profile-avatar-wrap {
  width: 100px;
  height: 100px;
}
.profile-shell .profile-avatar,
.profile-shell .profile-avatar-fallback {
  width: 100px;
  height: 100px;
  border-radius: 22px;
  box-shadow:
    0 0 0 1px rgba(232, 135, 49, 0.30),
    0 0 26px rgba(232, 135, 49, 0.20),
    0 16px 30px rgba(0, 0, 0, 0.48);
}
.profile-shell .profile-avatar-fallback {
  font-size: 1.7rem;
}

.profile-shell .profile-hero-copy h1 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  letter-spacing: -0.01em;
}

/* --- Profile: lower content grid ------------------------------------ */
/* (.profile-grid is set to 2 columns in the base rule; cards without
   .profile-card-wide now sit side-by-side instead of stacking sparsely.) */
.profile-grid > .panel.profile-card {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.profile-grid > .panel.profile-card:hover {
  border-color: rgba(232, 135, 49, 0.24);
}

/* --- Profile / Settings / Account: key-value rows -------------------- */
/* Clear hierarchy: muted label on the left, strong value on the right. */
.settings-shell .account-session-row,
.account-page-shell .account-session-row {
  padding: 0.5rem 0.15rem;
  gap: 0.9rem;
  align-items: center;
}
.settings-shell .account-session-row > span:first-child,
.account-page-shell .account-session-row > span:first-child {
  color: var(--muted);
}
.settings-shell .account-session-row > span:last-child,
.account-page-shell .account-session-row > span:last-child {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

/* --- Settings: hero + summary --------------------------------------- */
.settings-shell .forum-hero {
  padding: 1.5rem 1.6rem;
}

/* --- Settings: sessions list as tidy rows --------------------------- */
.settings-shell .sessions-list {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.2rem;
}
.settings-shell .sessions-list .account-session-row {
  align-items: center;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}
.settings-shell .sessions-list .account-session-row strong {
  color: var(--text);
}

/* --- Settings: 2FA backup code list --------------------------------- */
.settings-shell #twoFactorBackupList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0.6rem 0;
}
.settings-shell #twoFactorBackupList li {
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}
.settings-shell #twoFactorBackupList code {
  font-size: 0.95rem;
  letter-spacing: 0.06em;
}

/* --- Settings: danger zone ------------------------------------------ */
.settings-shell .settings-danger-card {
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(186, 68, 52, 0.10), transparent 55%),
    var(--panel-2);
}
.settings-shell .settings-danger-card .panel-header h2::before {
  background: linear-gradient(180deg, #f0a08a, var(--bad));
}

/* --- Settings: Account Summary visibility toggle + change-password modal --- */
.visibility-segment {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}
.visibility-seg-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.28rem 0.9rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.visibility-seg-btn:hover:not(.is-active):not(:disabled) {
  color: var(--text);
}
.visibility-seg-btn.is-active {
  color: #1b1205;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 2px 10px rgba(232, 135, 49, 0.32);
}
.visibility-seg-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.change-password-dialog {
  width: min(440px, calc(100vw - 2rem));
}

/* Themed delete-account confirmation modal (replaces the native window.confirm). */
.settings-delete-dialog {
  border-color: rgba(186, 68, 52, 0.42);
  background:
    radial-gradient(130% 90% at 100% 0%, rgba(186, 68, 52, 0.14), transparent 55%),
    var(--panel);
}
.settings-delete-confirm {
  background: linear-gradient(135deg, #e2655b, #b23b33);
  border-color: rgba(240, 130, 130, 0.45);
  color: #fff;
  font-weight: 700;
}
.settings-delete-confirm:hover {
  border-color: rgba(240, 130, 130, 0.7);
}

/* Premium Package: the package card itself links to the premium page. */
a.account-premium-package {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
a.account-premium-package:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 135, 49, 0.5);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.30);
}

/* Tighten the Sign-in & Security + Premium cards so they hug their content
   (the grid uses align-items: start, so neither is stretched to the other). */
.settings-security-card .settings-security-col {
  gap: 0.6rem;
}
.settings-grid > .panel:not(.settings-card-full) > .account-premium-package {
  margin: 0.75rem 0 0.4rem;
}

/* BM-194: "View Stats" button row in the profile hero. */
.profile-hero-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.profile-hero-quick-actions[hidden] {
  display: none;
}

/* The Linked Accounts hero subpanel is JS-hidden (no/hidden linked accounts), but
   .profile-hero-subpanel { display: grid } would otherwise override the UA [hidden]
   rule and leave an empty panel showing. Honour the hidden state. */
#profileLinkedAccountsPanel[hidden] {
  display: none !important;
}

/* Theme toggle relocated to the bottom of the Account page as two buttons. */
.settings-theme-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 0.3rem;
}

/* Account Summary spans the full grid width (it now holds identity + linked accounts). */
.settings-grid > .settings-card-full {
  grid-column: 1 / -1;
}

/* Linked accounts merged into Account Summary: compact rows under the visibility
   toggle (icon + name + a right-aligned Link/Unlink button). Reuses the existing
   .profile-link-block link/guest/linked-state structure so the JS and its
   [hidden] toggling keep working. */
.settings-linked-accounts {
  margin-top: 0.95rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.settings-linked-accounts .settings-linked-intro {
  margin: 0 0 0.7rem;
}
.settings-linked-accounts .profile-link-grid {
  margin-top: 0;
  gap: 0.6rem;
}
.settings-linked-accounts .profile-link-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
  text-align: left;
  padding: 0.6rem 0.85rem;
}
.settings-linked-accounts .profile-link-icon {
  width: 2.3rem;
  height: 2.3rem;
  flex: 0 0 auto;
}
.settings-linked-accounts .profile-link-icon svg,
.settings-linked-accounts .profile-link-icon .profile-link-icon-image {
  width: 1.25rem;
  height: 1.25rem;
}
.settings-linked-accounts .profile-link-name {
  font-weight: 700;
  color: var(--text);
}
.settings-linked-accounts .profile-link-block .stack-form,
.settings-linked-accounts .profile-link-block .profile-link-guest {
  width: auto;
  margin-left: auto;
  display: grid;
  justify-items: end;
  gap: 0.3rem;
}
/* Keep hidden link/guest states hidden — the display rules above would otherwise re-show them. */
.settings-linked-accounts .profile-link-block .stack-form[hidden],
.settings-linked-accounts .profile-link-block .profile-link-guest[hidden] {
  display: none !important;
}

/* Merged "Sign-in & Security" panel: two internal columns — Password & Access
   on the left, Two-Factor Authentication on the right — split by a divider. */
.settings-security-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  align-items: start;
}
.settings-security-col {
  display: grid;
  gap: 0.7rem;
  align-content: start;
  min-width: 0;
}
.settings-security-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.settings-security-col-head h3 {
  position: relative;
  padding-left: 0.7rem;
  font-size: 1.02rem;
}
.settings-security-col-head h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.14em;
  bottom: 0.14em;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}
.settings-security-col #twoFactorQr {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}
@media (min-width: 781px) {
  .settings-security-grid > .settings-security-col:first-child {
    padding-right: 0.9rem;
  }
  .settings-security-grid > .settings-security-col + .settings-security-col {
    padding-left: 0.9rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
  }
}
@media (max-width: 780px) {
  .settings-security-grid {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }
  .settings-security-grid > .settings-security-col + .settings-security-col {
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
}

/* A hidden .stack-form must STAY hidden: `.stack-form { display: grid }` is an
   author rule that otherwise beats the UA `[hidden] { display: none }`, which
   would leak the 2FA challenge form onto the sign-in card before the password
   step. JS toggling `.hidden` still works (the attr is removed to reveal). */
.stack-form[hidden] {
  display: none !important;
}

/* --- Account (Sign-In): focused auth card --------------------------- */
.account-auth-card .account-auth-head {
  display: grid;
  gap: 0.4rem;
  text-align: center;
  margin-bottom: 1.15rem;
}
.account-auth-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.account-auth-head h1 {
  font-size: clamp(1.7rem, 4vw, 2.1rem);
}
.account-auth-head .muted {
  margin: 0;
  max-width: 42ch;
  margin-inline: auto;
  line-height: 1.5;
}

/* Stacked, full-width primary actions for the auth forms. */
.account-auth-card .stack-form .form-actions {
  flex-direction: column;
  gap: 0.55rem;
}
.account-auth-card .stack-form .form-actions .btn {
  width: 100%;
}

/* Forgot password tucked into a quiet disclosure so the card stays calm. */
.account-forgot {
  margin-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 0.85rem;
}
.account-forgot > summary {
  cursor: pointer;
  list-style: none;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 160ms ease;
}
.account-forgot > summary::-webkit-details-marker {
  display: none;
}
.account-forgot > summary:hover,
.account-forgot[open] > summary {
  color: var(--text);
}
.account-forgot .stack-form {
  margin-top: 0.8rem;
}

.account-auth-card .account-cta-block {
  margin-top: 1.05rem;
  justify-items: center;
  text-align: center;
}

/* --- Mobile: collapse the focused auth actions stays full width ------ */
@media (max-width: 640px) {
  .profile-shell .profile-avatar-wrap,
  .profile-shell .profile-avatar,
  .profile-shell .profile-avatar-fallback {
    width: 84px;
    height: 84px;
  }
  .settings-shell #twoFactorBackupList {
    grid-template-columns: 1fr;
  }
}

/* Alliance system (BM-254) */
/* The global `.profile-card { min-height: 100% }` makes a standalone alliance
   panel stretch to its (tall) parent's full height — on the groups page the
   alliance panel sits in the block-flow #groupsApp (whose height is driven by
   the 760px chat workspace), so it ballooned to ~1250px and overflowed past
   the footer. Size alliance panels to their own content instead. */
#groupsApp > .panel,
#clanTabAllies .clan-roster-grid > .panel {
  min-height: 0;
}

.alliance-root {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.alliance-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid rgba(120, 140, 170, 0.18);
  border-radius: 12px;
  background: rgba(12, 18, 16, 0.45);
}
.alliance-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.92rem;
}
.alliance-toggle input {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}
.alliance-field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted, #93a4bd);
  margin-bottom: 0.35rem;
}
.alliance-search-input {
  width: 100%;
}
.alliance-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.alliance-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.alliance-section-title {
  font-size: 0.95rem;
  margin: 0.25rem 0 0;
}
.alliance-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(120, 140, 170, 0.18);
  border-radius: 12px;
  background: rgba(12, 18, 16, 0.4);
}
.alliance-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.alliance-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.alliance-badge {
  display: inline-block;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(120, 140, 170, 0.28);
  color: var(--muted, #93a4bd);
  background: rgba(113, 131, 165, 0.12);
}
.alliance-badge.is-on {
  color: #f4c89a;
  border-color: rgba(232, 135, 49, 0.55);
  background: rgba(232, 135, 49, 0.16);
}
.alliance-presence {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(120, 140, 170, 0.14);
}
.alliance-presence-meta {
  font-size: 0.78rem;
  color: var(--muted, #93a4bd);
}
.alliance-presence-meta.alliance-muted {
  font-style: italic;
}
.alliance-presence-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
}
.alliance-presence-name {
  font-weight: 600;
}
.alliance-presence-detail {
  margin-left: auto;
  font-size: 0.76rem;
  color: var(--muted, #93a4bd);
}
.alliance-dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(7, 12, 10, 0.92);
}
.alliance-dot.is-online {
  background: #e88731;
}
.alliance-dot.is-offline {
  background: #7183a5;
}

/* ===================================================================== */
/* BM-260: Visual pass for the Clan, Group & Forum community pages       */
/* Scoped to the four page shells (.clan-browser-shell / .clan-hub-shell */
/* / .groups-shell / .forum-shell) so the rest of the site is untouched. */
/* Appended last to layer over the base cascade. Lenses: typeset /       */
/* layout / delight (bold braai identity) / optimize.                    */
/* ===================================================================== */

.clan-browser-shell,
.clan-hub-shell,
.groups-shell,
.forum-shell {
  --bm-kicker: #ffba7d;
  --bm-rule: linear-gradient(90deg, rgba(232, 135, 49, 0.85), rgba(232, 135, 49, 0));
  --bm-warm-border: rgba(224, 135, 55, 0.2);
  --bm-warm-fill: linear-gradient(180deg, rgba(34, 24, 18, 0.5), rgba(16, 12, 10, 0.32));
  --bm-item-fill: linear-gradient(160deg, rgba(38, 27, 20, 0.5), rgba(20, 15, 12, 0.46));
}

/* A little more air between the major sections of each page. */
.clan-hub-shell,
.groups-shell,
.forum-shell {
  gap: 1.2rem;
}

/* --- Typeset: section kicker. The .eyebrow markup already sits above every
   panel heading but is globally hidden; re-enable it here as a flame kicker
   with a glowing ember mark, so each section gets a labelled title block. */
.clan-browser-shell .eyebrow,
.clan-hub-shell .eyebrow,
.groups-shell .eyebrow,
.forum-shell .eyebrow {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.42rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bm-kicker);
}

.clan-browser-shell .eyebrow::before,
.clan-hub-shell .eyebrow::before,
.groups-shell .eyebrow::before,
.forum-shell .eyebrow::before {
  content: "";
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 999px;
  background: radial-gradient(circle at 34% 30%, #ffe0bb, var(--accent) 58%, #a63f1a);
  box-shadow: 0 0 7px rgba(232, 135, 49, 0.75);
  flex: none;
}

/* --- Typeset: stronger, clearer heading scale. Section titles get more
   size + weight + a tight track so they separate from the body cleanly. */
.clan-browser-shell .panel-header h2,
.clan-hub-shell .panel-header h2,
.groups-shell .panel-header h2,
.forum-shell .panel-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.12;
}

.clan-browser-shell .panel-header h3,
.clan-hub-shell .panel-header h3,
.groups-shell .panel-header h3,
.forum-shell .panel-header h3 {
  font-size: 1.12rem;
  font-weight: 700;
}

/* Section subtitle under a heading: brighter + roomier than flat muted. */
.clan-browser-shell .panel-header .muted.small,
.clan-hub-shell .panel-header .muted.small,
.groups-shell .panel-header .muted.small,
.forum-shell .panel-header .muted.small {
  margin-top: 0.3rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(201, 191, 178, 0.82);
  max-width: 62ch;
}

/* --- Typeset + Layout: a hairline and ember tick under each section header
   draw a clean line between the title block and the features beneath it. */
.clan-browser-shell .panel-header,
.clan-hub-shell .panel-header,
.groups-shell .panel-header,
.forum-shell .panel-header {
  position: relative;
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.clan-browser-shell .panel-header::after,
.clan-hub-shell .panel-header::after,
.groups-shell .panel-header::after,
.forum-shell .panel-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 2.4rem;
  height: 2px;
  border-radius: 2px;
  background: var(--bm-rule);
}

/* Hero headings get a real display size on forum + thread pages. */
.forum-shell .forum-hero h1,
.forum-shell .forum-detail-wrap h1 {
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

/* --- Layout + Delight: unify the warm braai identity. The clan browser
   already runs warm charcoal/amber; bring the forum + group surfaces and the
   hero panels into the same family instead of the old cold navy. */
.forum-shell .forum-hero,
.forum-shell .forum-detail-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(224, 135, 55, 0.26);
  background:
    radial-gradient(circle at top right, rgba(224, 135, 55, 0.16), transparent 42%),
    linear-gradient(150deg, rgba(30, 21, 15, 0.96), rgba(13, 11, 10, 0.98));
}

/* Warm the group workspace columns (were cold navy). */
.groups-shell .groups-sidebar,
.groups-shell .groups-chat-column,
.groups-shell .groups-members-column {
  border-color: var(--bm-warm-border);
  background:
    var(--bm-warm-fill),
    rgba(9, 13, 22, 0.55);
}

/* Promote the standalone section cards to the same warm charcoal the clan
   browser already uses, so hero + content read as one braai surface. */
.forum-shell .forum-posts-wrap,
.forum-shell .forum-comments-panel,
.groups-shell #groupsApp,
.groups-shell #groupsGuestPanel {
  border: 1px solid rgba(224, 135, 55, 0.18);
  background: linear-gradient(180deg, rgba(32, 23, 18, 0.96), rgba(17, 13, 10, 0.98));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

/* The forum browse panel only wraps the posts card; unwrap it so we show a
   single clean card instead of a nested card-in-card. */
.forum-shell .forum-grid {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.forum-shell .forum-detail-body {
  border-color: var(--bm-warm-border);
  background:
    var(--bm-warm-fill),
    rgba(9, 13, 22, 0.45);
}

/* Warm the interactive items so the whole surface reads as one braai room
   rather than warm container + cold cards. Hover/active/selected/pending
   states already light up ember, so they layer on top of this cleanly. */
.groups-shell .groups-sidebar-item,
.groups-shell .groups-chat-message,
.groups-shell .groups-member-item,
.forum-shell .forum-post-item,
.forum-shell .forum-comment-item {
  border-color: rgba(224, 135, 55, 0.14);
  background:
    var(--bm-item-fill),
    rgba(12, 16, 24, 0.4);
}

/* --- Delight: feed/section tabs get an ember-lit active state. */
.forum-shell .forum-feed-tab.is-active {
  border-color: rgba(255, 179, 108, 0.78);
  box-shadow: inset 0 0 0 1px rgba(232, 135, 49, 0.35), 0 6px 16px rgba(232, 135, 49, 0.14);
}

/* --- Delight: primary action gets a warmer ember bloom on hover. */
.clan-browser-shell .btn-primary:hover,
.clan-hub-shell .btn-primary:hover,
.groups-shell .btn-primary:hover,
.forum-shell .btn-primary:hover {
  box-shadow: 0 14px 30px rgba(232, 135, 49, 0.42), inset 0 0 0 1px rgba(255, 214, 170, 0.32);
}

/* --- Optimize / a11y: a visible, on-brand focus ring on every control. */
.clan-browser-shell .btn:focus-visible,
.clan-hub-shell .btn:focus-visible,
.groups-shell .btn:focus-visible,
.forum-shell .btn:focus-visible,
.clan-browser-shell :is(input, select, textarea):focus-visible,
.clan-hub-shell :is(input, select, textarea):focus-visible,
.groups-shell :is(input, select, textarea):focus-visible,
.forum-shell :is(input, select, textarea):focus-visible {
  outline: 2px solid rgba(255, 179, 108, 0.72);
  outline-offset: 2px;
}

/* --- Typeset: align numeric stats so strength / member counts read cleanly. */
.clan-browser-shell .clan-browser-card-stats,
.clan-browser-shell .clan-browser-owned-meta,
.clan-hub-shell .clan-summary-stats {
  font-variant-numeric: tabular-nums;
}

/* --- Delight: warmer, centered empty states with a dashed ember frame. */
.clan-browser-shell .profile-social-empty,
.clan-hub-shell .profile-social-empty,
.groups-shell .profile-social-empty,
.forum-shell .profile-social-empty {
  text-align: center;
  padding: 1.4rem 1.1rem;
  border-style: dashed;
  border-color: rgba(224, 135, 55, 0.22);
  background: rgba(224, 135, 55, 0.04);
}

/* Mobile: ease the section rhythm so headers don't crowd on small screens. */
@media (max-width: 640px) {
  .clan-browser-shell .panel-header h2,
  .clan-hub-shell .panel-header h2,
  .groups-shell .panel-header h2,
  .forum-shell .panel-header h2 {
    font-size: 1.32rem;
  }
}

/* ===================================================================== */
/* BM-260b: Bold restyle + gamification (clan / group / forum)           */
/* Stronger headers, tactile game-CTA buttons, roomier panels, gamified  */
/* clan stat tiles with a hero Wipe Score. Layers over BM-260.           */
/* ===================================================================== */

/* Roomier rhythm between the major sections. */
.clan-browser-shell,
.clan-hub-shell,
.groups-shell,
.forum-shell {
  gap: 1.5rem;
}

/* More breathing room inside the main section panels. */
.clan-hub-shell > .panel,
.clan-browser-shell > .panel,
.forum-shell > .panel,
.forum-shell .forum-posts-wrap,
.forum-shell .forum-comments-panel {
  padding: 1.5rem 1.65rem;
}

/* --- Bigger, bolder section headers + kickers. */
.clan-browser-shell .panel-header h2,
.clan-hub-shell .panel-header h2,
.groups-shell .panel-header h2,
.forum-shell .panel-header h2 {
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.clan-browser-shell .eyebrow,
.clan-hub-shell .eyebrow,
.groups-shell .eyebrow,
.forum-shell .eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.2em;
}

.clan-browser-shell .panel-header::after,
.clan-hub-shell .panel-header::after,
.groups-shell .panel-header::after,
.forum-shell .panel-header::after {
  width: 3rem;
  height: 3px;
}

/* --- Tactile, game-CTA buttons. */
.clan-browser-shell .btn,
.clan-hub-shell .btn,
.groups-shell .btn,
.forum-shell .btn {
  min-height: 3rem;
  padding: 0.72rem 1.25rem;
  font-weight: 800;
}

.clan-browser-shell .btn-small,
.clan-hub-shell .btn-small,
.groups-shell .btn-small,
.forum-shell .btn-small {
  min-height: 2.5rem;
  padding: 0.5rem 0.9rem;
}

.clan-browser-shell .btn-primary,
.clan-hub-shell .btn-primary,
.groups-shell .btn-primary,
.forum-shell .btn-primary {
  background: linear-gradient(135deg, #ff9a45, #d4541f);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 26px rgba(232, 135, 49, 0.32), inset 0 1px 0 rgba(255, 220, 180, 0.32);
}

/* --- Gamified clan stat tiles. Drop the (banned) side stripe, warm them
   up, enlarge the numbers, and make Wipe Score the glowing hero stat. */
.clan-hub-shell .clan-stat-card::before {
  display: none;
}

.clan-hub-shell .clan-summary-stats {
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.8rem;
}

.clan-hub-shell .clan-stat-card {
  min-height: 5.4rem;
  border-radius: 1rem;
  border-color: rgba(224, 135, 55, 0.2);
  background:
    radial-gradient(circle at 86% 10%, rgba(232, 135, 49, 0.14), transparent 42%),
    linear-gradient(150deg, rgba(40, 28, 21, 0.85), rgba(20, 15, 12, 0.85));
  align-content: center;
}

.clan-hub-shell .clan-stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

.clan-hub-shell .clan-stat-value {
  font-size: clamp(1.3rem, 2.1vw, 1.65rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.clan-hub-shell .clan-stat-card.is-primary {
  border-color: rgba(255, 167, 77, 0.46);
  background:
    radial-gradient(circle at 88% 4%, rgba(255, 167, 77, 0.32), transparent 46%),
    linear-gradient(150deg, rgba(232, 135, 49, 0.22), rgba(24, 17, 13, 0.92));
  box-shadow: 0 0 0 1px rgba(255, 167, 77, 0.2), 0 16px 34px rgba(0, 0, 0, 0.28);
}

.clan-hub-shell .clan-stat-card.is-primary .clan-stat-label {
  color: var(--accent-2);
}

.clan-hub-shell .clan-stat-card.is-primary .clan-stat-value {
  font-size: clamp(1.7rem, 2.8vw, 2.1rem);
  letter-spacing: -0.01em;
  color: #ffd9b0;
}

/* The clan-info name reads as a banner title. */
.clan-hub-shell .clan-info-name-button {
  font-size: clamp(2rem, 3.6vw, 2.7rem);
}

/* Clan info: avatar + name as a header row, stats full-width below, instead
   of the avatar floating centered in the middle of the card. */
/* Clan info card: lay the card out as a flex column with ONE consistent gap so
   every child (title, avatar, tag/summary, stat tiles, review panel, status)
   is evenly spaced and nothing can touch. (They were block-flow siblings with
   no margins between them, so added blocks like the stats and review panel
   collapsed together.) */
.clan-hub-shell #clanTabInfo .clan-info-grid > .profile-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.clan-hub-shell #clanTabInfo .clan-info-title-wrap,
.clan-hub-shell #clanTabInfo .clan-avatar-editor {
  margin: 0;
}

.clan-hub-shell #clanTabInfo .clan-avatar-editor {
  justify-content: flex-start;
}

.clan-hub-shell #clanTabInfo .clan-summary-card {
  gap: 0.85rem;
}

/* Empty status lines must not add a phantom flex gap at the bottom. */
.clan-hub-shell #clanTabInfo #clanProfileStatus:empty,
.clan-hub-shell #clanTabInfo #clanInfoEditMeta:empty {
  display: none;
}

/* "Your Clans" square hover: the square clips its logo with overflow:hidden +
   border-radius, and a scale() transform breaks that clip in Chrome so the
   card's border vanishes on hover. Use a plain lift (no scale) for these
   squares so the rounded border survives. */
.clan-browser-shell .clan-browser-owned-square:hover,
.clan-browser-shell .clan-browser-owned-square:focus-visible {
  transform: translateY(-3px);
}

/* Forum post/comment meta as labelled chips with icons (score / upvotes /
   downvotes / comments / status). */
.forum-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.forum-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
}

.forum-meta-icon {
  width: 0.9em;
  height: 0.9em;
  flex: none;
  fill: currentColor;
}

.forum-meta-chip.is-score {
  color: #ffd9a8;
  background: rgba(232, 135, 49, 0.12);
  border-color: rgba(232, 135, 49, 0.3);
}

.forum-meta-chip.is-up {
  color: #9fdcb4;
  background: rgba(126, 199, 130, 0.12);
  border-color: rgba(126, 199, 130, 0.32);
}

.forum-meta-chip.is-down {
  color: #f0a6a6;
  background: rgba(240, 130, 130, 0.12);
  border-color: rgba(240, 130, 130, 0.32);
}

.forum-meta-chip.is-comments {
  color: #bfe4ff;
  background: rgba(126, 199, 255, 0.12);
  border-color: rgba(126, 199, 255, 0.28);
}

.forum-meta-chip.is-status.is-hidden {
  color: #f0a6a6;
  background: rgba(240, 130, 130, 0.12);
  border-color: rgba(240, 130, 130, 0.34);
}

.forum-meta-chip.is-status.is-locked {
  color: #f0c46b;
  background: rgba(240, 196, 107, 0.12);
  border-color: rgba(240, 196, 107, 0.3);
}

.forum-meta-chip.is-status.is-active {
  color: #9fd9ad;
  background: rgba(126, 199, 130, 0.1);
  border-color: rgba(126, 199, 130, 0.24);
}

/* BM-262: clan avatar review panel (owner-only) — draft/pending/rejected state. */
.clan-hub-shell .clan-avatar-review {
  display: grid;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(224, 135, 55, 0.2);
  background: linear-gradient(150deg, rgba(40, 28, 21, 0.6), rgba(20, 15, 12, 0.5));
}

.clan-hub-shell .clan-avatar-review .muted.small {
  margin: 0;
  max-width: 64ch;
}

.clan-hub-shell .clan-avatar-review-badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.66rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.clan-hub-shell .clan-avatar-review-badge.is-pending {
  color: #ffe0b0;
  background: rgba(240, 196, 107, 0.14);
  border: 1px solid rgba(240, 196, 107, 0.4);
}

.clan-hub-shell .clan-avatar-review-badge.is-rejected {
  color: #ffc4c4;
  background: rgba(240, 130, 130, 0.14);
  border: 1px solid rgba(240, 130, 130, 0.42);
}

.clan-hub-shell .clan-avatar-review-badge.is-published {
  color: #bff0c8;
  background: rgba(126, 199, 130, 0.14);
  border: 1px solid rgba(126, 199, 130, 0.4);
}

.clan-hub-shell .clan-avatar-review-badge.is-draft {
  color: #bfe4ff;
  background: rgba(126, 199, 255, 0.12);
  border: 1px solid rgba(126, 199, 255, 0.34);
}

/* BM-262: admin clan avatar review queue rows (admin-oversight.html). */
.ao-avatar-review {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.ao-avatar-review + .ao-avatar-review {
  margin-top: 0.6rem;
}

.ao-avatar-emblem {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ao-avatar-emblem-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.04);
}

.ao-avatar-meta {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.ao-avatar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .ao-avatar-review {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .ao-avatar-actions {
    grid-column: 1 / -1;
  }
}

/* BM-261: inbound / outbound direction grouping in the Pending Invitations
   panel. Inbound (invites to you) reads cool/blue, outbound (your clan's
   sent invites) reads ember, with a labelled badge per group. */
.clan-hub-shell .clan-invite-group + .clan-invite-group {
  margin-top: 1.15rem;
}

.clan-hub-shell .clan-invite-group-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.clan-hub-shell .clan-invite-dir-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.62rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.clan-hub-shell .clan-invite-dir-badge.is-inbound {
  color: #bfe4ff;
  background: rgba(126, 199, 255, 0.12);
  border: 1px solid rgba(126, 199, 255, 0.34);
}

.clan-hub-shell .clan-invite-dir-badge.is-outbound {
  color: #ffd9b0;
  background: rgba(232, 135, 49, 0.14);
  border: 1px solid rgba(232, 135, 49, 0.4);
}

.clan-hub-shell .clan-invite-item.is-inbound {
  border-color: rgba(126, 199, 255, 0.26);
}

.clan-hub-shell .clan-invite-item.is-outbound {
  border-color: rgba(232, 135, 49, 0.28);
}

/* Site-wide fix: the global `input, select, textarea { width:100%; min-height }`
   rule also caught checkboxes + radios, blowing them up into giant detached
   boxes (clan-news "Pin this post", forum post-visibility options, etc.).
   Reset them to native controls. Higher specificity, so it wins regardless of
   where the page's other input rules sit. */
input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: 0;
  padding: 0;
  margin: 0;
  border-radius: 0;
  border: 0;
  background: none;
  flex: none;
  accent-color: var(--accent);
}

/* The clan News tab holds a single panel, but clan-news-grid was 2 columns
   (leaving the right half empty). Make it full width. */
.clan-hub-shell .clan-news-grid {
  grid-template-columns: minmax(0, 1fr);
}

/* ============================================================
   Home "sell the server" pitch panel  (.bm-pitch)
   Immersive full-bleed conversion section on index.html, placed
   above the Client Guide. System fonts, warm-braai palette, 8pt
   spacing rhythm. One goal: download the desktop client.
   ============================================================ */
.bm-pitch {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(232, 135, 49, 0.28);
  /* Layered: dark legibility scrim over a directional scrim over the
     gameplay image. Swap the url() for a different /web-images asset to
     re-skin the hero backdrop. */
  background:
    linear-gradient(180deg, rgba(6, 10, 18, 0.72), rgba(4, 7, 14, 0.9) 64%, rgba(20, 14, 10, 0.9)),
    linear-gradient(110deg, rgba(8, 13, 24, 0.94) 30%, rgba(8, 13, 24, 0.55) 78%, rgba(8, 13, 24, 0.2)),
    url("/web-images/Rust-Experience.jpg");
  background-size: cover;
  background-position: center top;
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 3.5rem);
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
}

/* Ember glow + faint hatch, painted above the background but below content. */
.bm-pitch-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 70% at 88% -10%, rgba(232, 135, 49, 0.3), transparent 60%),
    radial-gradient(50% 60% at 2% 112%, rgba(126, 199, 255, 0.1), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 20px);
  opacity: 0.9;
}

.bm-pitch > *:not(.bm-pitch-glow) {
  position: relative;
  z-index: 1;
}

/* ---- Lead: kicker, headline, lede, facts, CTA ---- */
.bm-pitch-lead {
  display: grid;
  gap: 1rem;
}

.bm-pitch-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffba7d;
}

.bm-pitch-ember {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffd6aa, #e88731 60%, #b8521f);
  box-shadow: 0 0 10px rgba(232, 135, 49, 0.8);
}

.bm-pitch-title {
  margin: 0;
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.015em;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
}

.bm-pitch-title em {
  color: var(--accent-2);
  font-style: normal;
}

.bm-pitch-lede {
  margin: 0;
  max-width: 60ch;
  color: rgba(225, 234, 247, 0.9);
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.6;
}

.bm-pitch-facts {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.bm-pitch-facts li {
  display: grid;
  gap: 0.15rem;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(232, 135, 49, 0.22);
  background: linear-gradient(160deg, rgba(38, 27, 20, 0.5), rgba(16, 12, 10, 0.42));
}

.bm-pitch-facts strong {
  font-size: 1rem;
  color: var(--text);
}

.bm-pitch-facts span {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---- Feature grid (what you get) ---- */
.bm-pitch-features {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bm-feature {
  position: relative;
  display: grid;
  gap: 0.55rem;
  align-content: start;
  padding: 1.25rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(20, 28, 44, 0.72), rgba(10, 15, 26, 0.82));
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.bm-feature:hover {
  transform: translateY(-3px);
  border-color: rgba(232, 135, 49, 0.5);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(232, 135, 49, 0.16);
}

.bm-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  color: var(--accent-2);
  border: 1px solid rgba(232, 135, 49, 0.3);
  background: linear-gradient(135deg, rgba(232, 135, 49, 0.22), rgba(232, 135, 49, 0.06));
}

.bm-feature-icon svg {
  width: 1.4rem;
  height: 1.4rem;
}

.bm-feature h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
}

.bm-feature p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.94rem;
}

/* ---- Integrity band (what makes us unique) ---- */
.bm-pitch-integrity {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border-radius: 16px;
  border: 1px solid rgba(232, 135, 49, 0.2);
  background:
    radial-gradient(circle at 50% -20%, rgba(232, 135, 49, 0.14), transparent 45%),
    linear-gradient(180deg, rgba(34, 24, 18, 0.5), rgba(16, 12, 10, 0.36));
}

.bm-integrity-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bm-integrity-card {
  display: grid;
  gap: 0.4rem;
}

.bm-integrity-card h3 {
  position: relative;
  margin: 0;
  padding-left: 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.bm-integrity-card h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffb36c, #e88731);
}

.bm-integrity-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .bm-pitch-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bm-integrity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .bm-pitch-features,
  .bm-integrity-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .bm-pitch-facts li {
    flex: 1 1 40%;
  }
}

/* Respect reduced-motion: drop the hover lift. */
@media (prefers-reduced-motion: reduce) {
  .bm-feature {
    transition: none;
  }
  .bm-feature:hover {
    transform: none;
  }
}

/* ---- Click-to-expand affordance + stretched hit target ---- */
.bm-feature-more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-2);
  opacity: 0.82;
  transition: gap 140ms ease, opacity 140ms ease;
}

.bm-feature-more svg {
  width: 0.85rem;
  height: 0.85rem;
}

.bm-feature:hover .bm-feature-more {
  opacity: 1;
  gap: 0.5rem;
}

/* The whole card is clickable via an absolutely-positioned button that covers
   it. Keeps the heading/paragraph as valid flow content (no <button> wrapping
   block elements) while still giving keyboard users a single focusable target. */
.bm-feature-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  appearance: none;
}

.bm-feature-hit:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* ============================================================
   Feature detail modal (built + populated by serverPitch.js)
   ============================================================ */
body.bm-modal-open {
  overflow: hidden;
}

.bm-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.bm-modal[hidden] {
  display: none;
}

.bm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 9, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 200ms ease;
}

.bm-modal.is-open .bm-modal-backdrop {
  opacity: 1;
}

.bm-modal-dialog {
  position: relative;
  width: min(40rem, 100%);
  max-height: min(86vh, 48rem);
  overflow: auto;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: 18px;
  border: 1px solid rgba(232, 135, 49, 0.3);
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(232, 135, 49, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(18, 24, 38, 0.98), rgba(8, 12, 22, 0.99));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.3, 1), opacity 220ms ease;
}

.bm-modal.is-open .bm-modal-dialog {
  opacity: 1;
  transform: none;
}

.bm-modal-dialog:focus {
  outline: none;
}

.bm-modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.bm-modal-close:hover {
  color: var(--text);
  border-color: rgba(232, 135, 49, 0.5);
  background: rgba(232, 135, 49, 0.12);
}

.bm-modal-close svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.bm-modal-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1rem;
  padding-right: 2.5rem;
}

.bm-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  color: var(--accent-2);
  border: 1px solid rgba(232, 135, 49, 0.32);
  background: linear-gradient(135deg, rgba(232, 135, 49, 0.24), rgba(232, 135, 49, 0.06));
}

.bm-modal-icon svg {
  width: 1.6rem;
  height: 1.6rem;
}

.bm-modal-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  color: var(--text);
}

.bm-modal-body p {
  margin: 0 0 1rem;
  color: rgba(225, 234, 247, 0.9);
  line-height: 1.6;
}

.bm-modal-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.bm-modal-points li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--muted);
  line-height: 1.5;
}

.bm-modal-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffd6aa, #e88731 60%, #b8521f);
  box-shadow: 0 0 8px rgba(232, 135, 49, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  .bm-modal-backdrop,
  .bm-modal-dialog {
    transition: none;
  }
}


/* BM-414: Discord-markdown rendering (mdLite) + announcement image attachments */
.announcement-body {
  margin: 0.35rem 0 0;
  font-size: 1.5rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.md-h {
  display: block;
  font-weight: 700;
  line-height: 1.25;
  margin: 0.4rem 0 0.15rem;
}

.md-h1 { font-size: 1.9rem; }
.md-h2 { font-size: 1.7rem; }
.md-h3 { font-size: 1.55rem; }

.md-code,
.md-pre {
  font-family: "Consolas", "Menlo", monospace;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.md-code {
  padding: 0.05rem 0.35rem;
  font-size: 0.92em;
}

.md-pre {
  display: block;
  padding: 0.6rem 0.75rem;
  margin: 0.4rem 0;
  overflow-x: auto;
  white-space: pre;
}

.announcement-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.announcement-attachment-link {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.announcement-attachment-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

/* BM-414b: compact announcement thumbnail (homepage "Latest From Tongs") */
.announcement-layout {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.announcement-main {
  flex: 1 1 auto;
  min-width: 0;
}

.announcement-thumb {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.announcement-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.announcement-thumb-more {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.5;
}
