@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=DM+Serif+Display&display=swap');

:root {
  --font-scale: 1;
  --primary: #1f5a46;
  --primary-strong: #143f31;
  --primary-soft: #dfe9da;
  --accent: #d7bd70;
  --accent-soft: #fff5d5;
  --page: #eef2e8;
  --surface: #fffdf7;
  --surface-2: #f6f3e9;
  --surface-3: #e8eee2;
  --text: #17261f;
  --muted: #68766e;
  --line: #d5ddd2;
  --danger: #b84d49;
  --success: #2e9c6b;
  --warning: #be8c2a;
  --shadow: 0 2px 10px rgba(18,49,38,.08);
  --shadow-lg: 0 18px 60px rgba(13,39,29,.22);
  --radius: 16px;
  --topbar: 64px;
  --content-width: 1440px;
  color-scheme: light;
}

:root[data-mode="dark"] {
  --page: #101713;
  --surface: #19221d;
  --surface-2: #202b25;
  --surface-3: #28362e;
  --text: #edf4ee;
  --muted: #a7b3aa;
  --line: #33443a;
  --primary-soft: #244a3a;
  --accent-soft: #493f23;
  --shadow: 0 2px 12px rgba(0,0,0,.28);
  --shadow-lg: 0 18px 60px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; font-size: calc(16px * var(--font-scale)); }
body { min-height: 100vh; margin: 0; background: var(--page); color: var(--text); font-family: "DM Sans", system-ui, sans-serif; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
img { max-width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.icon { width: 20px; height: 20px; display: inline-block; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Boot */
.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 8px; background: linear-gradient(145deg,var(--primary-strong),var(--primary)); color: white; }
.boot-mark { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 22px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); font: 42px "DM Serif Display",serif; }
.boot-screen strong { font-size: 1.35rem; }
.boot-screen span { color: rgba(255,255,255,.75); font-size: .9rem; }

/* Authentication */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(360px,1.2fr) minmax(440px,.8fr); background: var(--surface); }
.auth-brand-panel { position: relative; padding: clamp(28px,5vw,76px); color: #fff; background:
  radial-gradient(circle at 90% 10%, rgba(215,189,112,.36), transparent 32%),
  radial-gradient(circle at 20% 90%, rgba(120,171,121,.28), transparent 35%),
  linear-gradient(145deg,#0f392b,#1f5a46 58%,#567d58); display: flex; flex-direction: column; overflow: hidden; }
.auth-brand-panel::after { content: "MMOnsterpatch"; position: absolute; right: -18px; bottom: -15px; color: rgba(255,255,255,.055); font: clamp(4rem,9vw,10rem) "DM Serif Display",serif; white-space: nowrap; pointer-events: none; }
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; width: fit-content; position: relative; z-index: 1; }
.brand-lockup img { width: 56px; height: 56px; }
.brand-lockup span { display: grid; }
.brand-lockup strong { font-size: 1.25rem; }
.brand-lockup small { color: rgba(255,255,255,.7); letter-spacing: .1em; text-transform: uppercase; font-size: .66rem; }
.auth-copy { max-width: 680px; margin: auto 0; position: relative; z-index: 1; }
.eyebrow { color: var(--accent); font-weight: 800; font-size: .75rem; letter-spacing: .16em; }
.auth-copy h1 {
    margin: 10px 0 18px;
    font-size: clamp(2.2rem, 4.2vw, 4.6rem);
    line-height: 1;
}
.auth-copy > p:last-child { color: rgba(255,255,255,.82); max-width: 630px; font-size: clamp(1rem,1.5vw,1.18rem); line-height: 1.65; }
.auth-highlights { display: grid; gap: 12px; max-width: 700px; position: relative; z-index: 1; }
.auth-highlights > div { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.07); border-radius: 13px; backdrop-filter: blur(10px); }
.feature-icon { width: 38px; height: 38px; display: grid; place-items: center; background: rgba(255,255,255,.12); border-radius: 11px; color: var(--accent); }
.auth-highlights span:last-child { display: grid; }
.auth-highlights small { color: rgba(255,255,255,.68); }
.auth-form-panel { padding: 35px; display: grid; align-content: center; justify-items: center; background: var(--page); }
.auth-card { width: min(500px,100%); padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: var(--surface-3); border-radius: 12px; margin-bottom: 24px; }
.auth-tab { border: 0; padding: 10px 12px; border-radius: 9px; background: transparent; font-weight: 800; color: var(--muted); }
.auth-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.auth-form h2 { margin: 0; font: 2rem "DM Serif Display",serif; color: var(--text); }
.auth-form > p { color: var(--muted); margin: 5px 0 22px; line-height: 1.5; }
.auth-form label, .modal form > label, .member-search-wrap label { display: grid; gap: 6px; margin-bottom: 14px; color: var(--text); font-weight: 700; font-size: .82rem; }
.auth-form input, .modal input, .modal select, .modal textarea, .member-search-wrap input, .settings-form input, .settings-form textarea { width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 11px; padding: 11px 12px; outline: none; transition: .15s; }
.auth-form input:focus, .modal input:focus, .modal select:focus, .modal textarea:focus, .member-search-wrap input:focus, .settings-form input:focus, .settings-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb,var(--primary) 18%,transparent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { min-height: 20px; color: var(--danger); font-size: .82rem; font-weight: 700; margin: 3px 0 8px; }
.primary-button,.secondary-button,.danger-button { border: 0; border-radius: 10px; padding: 10px 15px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.primary-button { background: var(--primary); color: white; }
.primary-button:hover { filter: brightness(1.08); }
.secondary-button { background: var(--surface-3); color: var(--text); }
.danger-button { background: var(--danger); color: white; }
.full { width: 100%; }
.text-button { width: 100%; margin-top: 10px; border: 0; background: transparent; color: var(--primary); font-weight: 700; }
.auth-server-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 13px; margin-top: 20px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.auth-server-card span:nth-child(2) { display: grid; }
.auth-server-card small { color: var(--muted); }
.player-count { font-size: 1.3rem; font-weight: 900; color: var(--primary); }
.legal-copy { font-size: .72rem; color: var(--muted); text-align: center; max-width: 450px; }

/* App shell */
.topbar { height: var(--topbar); position: sticky; top: 0; z-index: 100; background: color-mix(in srgb,var(--surface) 94%,transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.topbar-inner { height: 100%; max-width: var(--content-width); margin: auto; padding: 0 18px; display: grid; grid-template-columns: 250px minmax(260px,520px) 1fr; align-items: center; gap: 18px; }
.top-brand { display: flex; align-items: center; gap: 10px; color: var(--primary); font: 1.25rem "DM Serif Display",serif; }
.top-brand img { width: 42px; height: 42px; }
.global-search { display: flex; align-items: center; gap: 8px; background: var(--surface-3); border: 1px solid transparent; border-radius: 999px; padding: 9px 14px; color: var(--muted); }
.global-search:focus-within { border-color: var(--primary); background: var(--surface); }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; }
.top-nav { justify-self: end; display: flex; align-items: center; gap: 5px; }
.top-nav-button,.icon-button { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--surface-3); color: var(--text); }
.top-nav-button:hover,.top-nav-button.active,.icon-button:hover { background: var(--primary-soft); color: var(--primary); }
.nav-badge { position: absolute; right: -2px; top: -3px; min-width: 18px; height: 18px; padding: 0 4px; display: grid; place-items: center; border-radius: 999px; background: var(--danger); color: white; border: 2px solid var(--surface); font-size: .62rem; }
.account-menu-button { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; border-radius: 999px; padding: 3px 8px 3px 4px; font-weight: 800; }
.account-menu-button:hover { background: var(--surface-3); }
.chevron .icon { width: 15px; height: 15px; }
.app-layout { max-width: var(--content-width); margin: 0 auto; display: grid; grid-template-columns: 270px minmax(0,720px) 320px; justify-content: center; gap: 18px; padding: 18px; }
.left-sidebar,.right-sidebar { position: sticky; top: calc(var(--topbar) + 18px); align-self: start; max-height: calc(100vh - var(--topbar) - 36px); overflow: auto; scrollbar-width: thin; }
.sidebar-card,.content-card,.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.profile-shortcut { padding: 13px; margin-bottom: 12px; }
.profile-shortcut a { display: flex; align-items: center; gap: 11px; }
.profile-shortcut a > span:last-child { display: grid; min-width: 0; }
.profile-shortcut small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-shortcut-copy { gap: 1px; }
.profile-shortcut-guild { font-size: .68rem; opacity: .92; }
.side-nav { padding: 7px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 11px; font-weight: 700; margin: 2px 0; }
.side-nav a:hover,.side-nav a.active { background: var(--primary-soft); color: var(--primary-strong); }
.nav-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-3); color: var(--primary); }
.side-nav a.active .nav-icon { background: var(--primary); color: white; }
.main-content { min-width: 0; }
.right-sidebar { display: grid; gap: 12px; }
.server-card,.friends-card { padding: 15px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-size: 1rem; }
.section-heading a,.section-heading button { border: 0; background: transparent; color: var(--primary); font-size: .78rem; font-weight: 800; }
.server-status-line { display: flex; align-items: center; gap: 10px; }
.server-status-line > span:nth-child(2) { display: grid; }
.server-status-line small { color: var(--muted); }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: #a5aca7; box-shadow: 0 0 0 5px color-mix(in srgb,#a5aca7 16%,transparent); flex: 0 0 auto; }
.status-dot.online { background: var(--success); box-shadow: 0 0 0 5px color-mix(in srgb,var(--success) 18%,transparent); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 0 5px color-mix(in srgb,var(--danger) 18%,transparent); }
.server-player-block { margin-top: 14px; display: grid; place-items: center; padding: 14px; background: var(--surface-3); border-radius: 12px; }
.server-player-block strong { font-size: 1.7rem; color: var(--primary); }
.server-player-block span { color: var(--muted); font-size: .75rem; }
.friend-list { display: grid; gap: 3px; }
.friend-row { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 9px; padding: 7px; border-radius: 10px; text-align: left; }
.friend-row:hover { background: var(--surface-3); }
.friend-row-profile { flex: 1; min-width: 0; display: block; }
.friend-row-profile > span { display: grid; min-width: 0; }
.friend-row small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-row-message { width: 32px; height: 32px; flex: 0 0 auto; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: var(--primary); }
.friend-row-message:hover { background: var(--surface-2); }
.presence { width: 9px; height: 9px; border-radius: 50%; background: #929b95; border: 2px solid var(--surface); }
.presence.online { background: var(--success); }

/* Common */
.avatar { --avatar-size: 44px; width: var(--avatar-size); height: var(--avatar-size); border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; background: linear-gradient(145deg,var(--primary),var(--primary-strong)); color: white; font-weight: 900; border: 2px solid var(--surface); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-small { --avatar-size: 34px; }
.avatar-large { --avatar-size: 52px; }
.avatar-xl { --avatar-size: 118px; border-width: 5px; }
.verified-badge,.rank-badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; border-radius: 999px; padding: 5px 9px; font-size: .72rem; font-weight: 800; }
.verified-badge { background: var(--accent-soft); color: color-mix(in srgb,var(--accent) 35%,#3e3212); border: 1px solid color-mix(in srgb,var(--accent) 60%,transparent); }
.rank-badge { background: var(--surface-3); color: var(--primary); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.page-head h1 { margin: 0; font: 1.8rem "DM Serif Display",serif; }
.page-head p { margin: 3px 0 0; color: var(--muted); }
.loading-card,.empty-card,.error-card { padding: 34px 24px; text-align: center; }
.loading-card { color: var(--muted); }
.empty-card .empty-icon,.error-card .empty-icon { width: 58px; height: 58px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 18px; background: var(--surface-3); color: var(--primary); }
.empty-card h2,.error-card h2 { margin: 0 0 6px; font-size: 1.1rem; }
.empty-card p,.error-card p { margin: 0; color: var(--muted); }
.inline-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Feed */
.feed-stack { display: grid; gap: 12px; }
.composer-card { padding: 14px; }
.composer-top { display: flex; align-items: center; gap: 10px; }
.composer-launch { flex: 1; border: 0; background: var(--surface-3); border-radius: 999px; padding: 12px 16px; text-align: left; color: var(--muted); }
.composer-launch:hover { background: var(--primary-soft); }
.composer-bottom { display: flex; justify-content: center; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 9px; }
.composer-photo { border: 0; background: transparent; color: var(--primary); display: flex; gap: 7px; align-items: center; font-weight: 700; padding: 7px 14px; border-radius: 9px; }
.composer-photo:hover { background: var(--surface-3); }
.post-card { overflow: visible; }
.post-head { display: flex; gap: 10px; align-items: flex-start; padding: 14px 14px 8px; }
.post-author { flex: 1; min-width: 0; }
.post-author-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.post-author-line strong { font-size: .93rem; }
.post-meta { color: var(--muted); font-size: .72rem; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.post-menu-wrap { position: relative; }
.post-menu-button { border: 0; width: 36px; height: 36px; border-radius: 50%; background: transparent; display: grid; place-items: center; color: var(--muted); }
.post-menu-button:hover { background: var(--surface-3); }
.context-menu { position: absolute; right: 0; top: 38px; width: 210px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 30; }
.context-menu button { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 9px; text-align: left; padding: 9px 10px; border-radius: 8px; font-weight: 700; }
.context-menu button:hover { background: var(--surface-3); }
.context-menu button.danger { color: var(--danger); }
.context-subtitle { display: block; color: var(--muted); font-size: .65rem; font-weight: 500; }
.post-body { padding: 0 14px 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.post-media { width: 100%; max-height: 620px; object-fit: cover; display: block; background: var(--surface-3); border-block: 1px solid var(--line); }
.post-summary { display: flex; justify-content: space-between; padding: 9px 14px; color: var(--muted); font-size: .76rem; border-bottom: 1px solid var(--line); }
.post-actions { display: grid; grid-template-columns: repeat(3,1fr); padding: 5px 8px; }
.post-actions button { border: 0; background: transparent; border-radius: 8px; padding: 8px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-weight: 700; }
.post-actions button:hover { background: var(--surface-3); }
.post-actions button.active { color: var(--primary); }
.comment-area { border-top: 1px solid var(--line); padding: 10px 13px 13px; }
.comment-list { display: grid; gap: 8px; margin-bottom: 9px; }
.comment-row { display: flex; align-items: flex-start; gap: 8px; }
.comment-bubble { background: var(--surface-3); border-radius: 13px; padding: 8px 10px; flex: 1; }
.comment-bubble strong { display: block; font-size: .75rem; }
.comment-bubble p { margin: 2px 0 0; font-size: .82rem; white-space: pre-wrap; }
.comment-form { display: flex; align-items: center; gap: 7px; }
.comment-form input { flex: 1; border: 0; background: var(--surface-3); border-radius: 999px; padding: 9px 12px; outline: none; }
.comment-form button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--primary); color: white; display: grid; place-items: center; }

/* Profile / characters */
.profile-card { overflow: hidden; }
.profile-cover { height: 245px; background: linear-gradient(125deg,var(--primary-strong),var(--primary) 55%,var(--accent)); position: relative; }
.profile-cover::after { content: "MMOnsterpatch"; position: absolute; right: 24px; bottom: 8px; color: rgba(255,255,255,.14); font: clamp(2.5rem,7vw,4.5rem) "DM Serif Display",serif; }
.profile-main { display: flex; align-items: flex-end; gap: 16px; padding: 0 20px 18px; margin-top: -54px; position: relative; }
.profile-title { flex: 1; min-width: 0; padding-bottom: 5px; }
.profile-title h1 { margin: 0 0 7px; font: 1.8rem "DM Serif Display",serif; }
.profile-badges { display: flex; gap: 7px; flex-wrap: wrap; }
.profile-tabs { display: flex; gap: 3px; padding: 7px 12px; border-top: 1px solid var(--line); }
.profile-tabs a { padding: 9px 12px; border-radius: 9px; color: var(--muted); font-weight: 800; }
.profile-tabs a.active,.profile-tabs a:hover { color: var(--primary); background: var(--primary-soft); }
.section-card { padding: 17px; margin-top: 12px; }
.section-card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.character-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.character-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.character-card.main { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb,var(--accent) 28%,transparent); }
.character-art { height: 170px; display: grid; place-items: center; background: linear-gradient(145deg,var(--primary-soft),var(--accent-soft)); border-bottom: 1px solid var(--line); }
.character-art img { width: 132px; height: 132px; object-fit: contain; image-rendering: pixelated; }
.character-info { padding: 12px; }
.character-info h3 { margin: 0 0 5px; font-size: 1rem; }
.character-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .75rem; }
.main-character-control { display: flex; align-items: center; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 800; font-size: .8rem; }
.main-character-control input { width: 18px; height: 18px; accent-color: var(--primary); }
.main-character-label { position: absolute; right: 9px; top: 9px; z-index: 2; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent); padding: 4px 8px; color: #5f4d19; font-size: .68rem; font-weight: 900; }

/* Messages */
.messages-layout { height: calc(100vh - var(--topbar) - 36px); min-height: 610px; display: grid; grid-template-columns: 270px minmax(0,1fr); overflow: hidden; }
.thread-column { border-right: 1px solid var(--line); display: grid; grid-template-rows: auto auto 1fr; min-height: 0; }
.thread-head { display: flex; justify-content: space-between; align-items: center; padding: 14px; }
.thread-head h1 { margin: 0; font: 1.45rem "DM Serif Display",serif; }
.thread-search { margin: 0 11px 10px; display: flex; align-items: center; gap: 7px; background: var(--surface-3); border-radius: 999px; padding: 8px 11px; color: var(--muted); }
.thread-search input { min-width: 0; flex: 1; border: 0; background: transparent; outline: none; }
.thread-list { overflow: auto; padding: 0 6px 8px; }
.thread-row { width: 100%; display: flex; align-items: center; gap: 9px; border: 0; background: transparent; text-align: left; padding: 9px; border-radius: 11px; }
.thread-row:hover,.thread-row.active { background: var(--primary-soft); }
.thread-row > span:nth-child(2) { min-width: 0; flex: 1; display: grid; }
.thread-row small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-column { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; min-height: 0; }
.chat-head { padding: 11px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
.chat-head > span:nth-child(2) { display: grid; }
.chat-head small { color: var(--muted); }
.message-list { min-height: 0; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 7px; background: linear-gradient(var(--surface-2),var(--page)); }
.message-row { max-width: 76%; display: flex; align-items: flex-end; gap: 5px; }
.message-row.mine { align-self: flex-end; flex-direction: row-reverse; }
.message-bubble { padding: 9px 11px; border-radius: 15px 15px 15px 5px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.message-row.mine .message-bubble { background: var(--primary); color: white; border-color: transparent; border-radius: 15px 15px 5px 15px; }
.message-row.deleted .message-bubble { color: var(--muted); font-style: italic; background: var(--surface-3); }
.message-options { position: relative; }
.message-options > button { opacity: 0; border: 0; background: transparent; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.message-row:hover .message-options > button { opacity: 1; }
.message-options > button:hover { background: var(--surface-3); }
.chat-form { padding: 11px; display: flex; gap: 8px; border-top: 1px solid var(--line); }
.chat-form input { min-width: 0; flex: 1; border: 0; background: var(--surface-3); border-radius: 999px; padding: 10px 14px; outline: none; }
.chat-form button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--primary); color: white; }

/* Saved / friends / settings */
.tab-bar { display: flex; gap: 5px; padding: 6px; margin-bottom: 12px; }
.tab-bar button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 9px; font-weight: 800; color: var(--muted); }
.tab-bar button.active { background: var(--primary-soft); color: var(--primary); }
.member-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.member-card { display: flex; gap: 11px; align-items: center; padding: 13px; }
.member-profile-copy { flex: 1; min-width: 0; display: block; }
.member-profile-copy > span { display: grid; min-width: 0; }
.member-card small { color: var(--muted); }
.member-card-actions { display: flex; gap: 5px; }
.member-card-actions button { width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--primary); }
.settings-form { padding: 18px; display: grid; gap: 14px; }
.settings-form label { display: grid; gap: 6px; font-size: .82rem; font-weight: 800; }
.settings-form textarea { min-height: 100px; resize: vertical; }

/* Dropdowns, modals */
.floating-panel { position: fixed; z-index: 150; right: max(18px,calc((100vw - var(--content-width))/2 + 18px)); top: calc(var(--topbar) - 3px); width: 330px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 7px; }
.account-dropdown { width: 300px; }
.account-dropdown > a:not(.account-summary),.account-dropdown > button { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 9px; text-align: left; font-weight: 700; }
.account-dropdown > a:hover,.account-dropdown > button:hover { background: var(--surface-3); }
.account-summary { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.account-summary:hover { background: var(--surface-3); }
.account-summary > span:last-child { display: grid; }
.account-summary small { color: var(--muted); }
.menu-divider { height: 1px; background: var(--line); margin: 5px; }
.menu-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; font-weight: 700; }
.menu-toggle-row > span { display: flex; align-items: center; gap: 10px; }
.menu-toggle-row input { position: absolute; opacity: 0; }
.menu-toggle-row i { width: 42px; height: 24px; border-radius: 999px; background: #a9b1ac; position: relative; }
.menu-toggle-row i::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: white; transition: .18s; }
.menu-toggle-row input:checked + i { background: var(--primary); }
.menu-toggle-row input:checked + i::after { transform: translateX(18px); }
.floating-head { display: flex; justify-content: space-between; align-items: center; padding: 8px; }
.floating-head button { border: 0; background: transparent; color: var(--primary); font-size: .72rem; font-weight: 800; }
.notification-list { display: grid; max-height: 430px; overflow: auto; }
.notification-item { display: flex; gap: 9px; padding: 9px; border-radius: 9px; }
.notification-item.unread { background: var(--primary-soft); }
.notification-item > span:last-child { flex: 1; display: grid; }
.notification-item small { color: var(--muted); }
.modal-backdrop { position: fixed; z-index: 300; inset: 0; padding: 20px; display: grid; place-items: center; background: rgba(4,17,12,.65); backdrop-filter: blur(4px); }
.modal { width: min(600px,100%); max-height: min(800px,94vh); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
.modal.compact { width: min(470px,100%); }
.modal > header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--line); background: var(--surface); }
.modal > header h2 { margin: 0; font-size: 1.05rem; }
.modal form,.member-search-wrap { padding: 15px; }
.modal form textarea { min-height: 100px; resize: vertical; }
.modal [data-post-form] textarea { min-height: 190px; border: 0; background: transparent; font-size: 1.05rem; }
.composer-author { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.attachment-button { width: fit-content; display: flex !important; grid-auto-flow: column; align-items: center; gap: 7px !important; padding: 8px 10px; border-radius: 9px; background: var(--surface-3); color: var(--primary) !important; cursor: pointer; }
.attachment-button input { display: none; }
.media-preview { min-height: 160px; margin-bottom: 10px; border-radius: 12px; background-position: center; background-size: cover; border: 1px solid var(--line); }
.modal form footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.theme-presets { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.theme-preset { border: 2px solid transparent; border-radius: 12px; padding: 7px; background: var(--surface-2); }
.theme-preset.active { border-color: var(--primary); }
.theme-swatch { height: 60px; border-radius: 8px; margin-bottom: 5px; }
.theme-preset strong { font-size: .76rem; }
.theme-modal h3 { font-size: .86rem; margin: 18px 0 9px; }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-grid input { height: 48px; padding: 3px; }
.member-results { display: grid; gap: 5px; max-height: 320px; overflow: auto; }
.member-result { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 8px; border-radius: 9px; text-align: left; }
.member-result:hover { background: var(--surface-3); }
.member-result-copy > span { display: grid; min-width: 0; }
.member-result small { color: var(--muted); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 500; max-width: 370px; padding: 12px 15px; border-radius: 12px; background: var(--primary-strong); color: white; font-weight: 700; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(18px); pointer-events: none; transition: .18s; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 1200px) {
  .app-layout { grid-template-columns: 235px minmax(0,680px) 290px; }
  .topbar-inner { grid-template-columns: 220px minmax(220px,460px) 1fr; }
}
@media (max-width: 1000px) {
  .app-layout { grid-template-columns: 78px minmax(0,680px) 280px; }
  .profile-shortcut { display: none; }
  .side-nav { padding: 6px; }
  .side-nav a { justify-content: center; padding: 8px; }
  .side-nav a > span:last-child { display: none; }
  .topbar-inner { grid-template-columns: 55px minmax(180px,1fr) auto; }
  .top-brand span,.account-menu-name { display: none; }
}
@media (max-width: 800px) {
  :root { --topbar: 60px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand-panel { min-height: 420px; padding: 28px; }
  .auth-highlights { display: none; }
  .auth-form-panel { padding: 22px; }
  .app-layout { display: block; padding: 10px 9px 80px; }
  .right-sidebar { position: static; max-height: none; overflow: visible; grid-template-columns: 1fr 1fr; margin-bottom: 10px; }
  .left-sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 120; max-height: none; background: var(--surface); border-top: 1px solid var(--line); }
  .side-nav { border: 0; border-radius: 0; box-shadow: none; display: grid; grid-template-columns: repeat(6,1fr); }
  .side-nav a { display: grid; gap: 1px; place-items: center; font-size: .58rem; padding: 3px; }
  .side-nav a > span:last-child { display: block; }
  .nav-icon { width: 30px; height: 28px; background: transparent; }
  .top-nav > a:first-of-type,.top-nav > a:last-of-type { display: none; }
  .account-menu-button { padding-right: 2px; }
  .global-search { min-width: 0; }
  .messages-layout { height: calc(100vh - var(--topbar) - 95px); grid-template-columns: 1fr; }
  .messages-layout.thread-selected .thread-column { display: none; }
  .messages-layout:not(.thread-selected) .chat-column { display: none; }
  .profile-cover { height: 190px; }
  .character-grid,.member-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar-inner { grid-template-columns: 44px 1fr auto; padding: 0 8px; gap: 6px; }
  .top-brand img { width: 38px; height: 38px; }
  .global-search { padding: 8px 10px; }
  .top-nav-button { width: 38px; height: 38px; }
  .account-menu-button .chevron { display: none; }
  .right-sidebar { grid-template-columns: 1fr; }
  .form-grid,.color-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 18px; }
  .auth-brand-panel { min-height: 340px; }
  .profile-main { align-items: center; flex-wrap: wrap; }
  .profile-title { min-width: 180px; }
  .profile-main .secondary-button { margin-left: auto; }
  .avatar-xl { --avatar-size: 92px; }
  .theme-presets { grid-template-columns: repeat(2,1fr); }
  .floating-panel { left: 8px; right: 8px; width: auto; }
  .message-row { max-width: 90%; }
}


/* Live-candidate additions */
.audience-selector { display: flex !important; grid-template-columns: auto minmax(150px,1fr); align-items: center; gap: 8px !important; width: fit-content; margin: 4px 0 8px; font-size: .76rem !important; color: var(--muted) !important; }
.audience-selector select { padding: 7px 30px 7px 10px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); color: var(--text); font-weight: 800; }
.compact-grid { margin-top: 10px; }
.request-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.request-actions { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.primary-button.small,.secondary-button.small { min-height: 34px; padding: 7px 10px; font-size: .72rem; }
.relationship-label { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 10px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: .72rem; font-weight: 900; }
.member-result-copy { display: grid; min-width: 0; flex: 1; }
.member-result-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.member-result-actions .icon-button { flex: 0 0 auto; }
@media (max-width:560px) {
  .member-result { align-items: flex-start; flex-wrap: wrap; }
  .member-result-actions { width: 100%; padding-left: 48px; justify-content: flex-start; }
}

.document-page { background: var(--page); }
.document-topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px max(18px,calc((100vw - 980px)/2)); background: var(--surface); border-bottom: 1px solid var(--line); }
.document-topbar > a:first-child { display: flex; align-items: center; gap: 10px; color: var(--primary); }
.document-topbar img { width: 42px; height: 42px; }
.document-shell { width: min(920px,calc(100% - 28px)); margin: 30px auto; }
.document-card { padding: clamp(20px,4vw,46px); }
.document-card h1 { margin-top: 8px; font: clamp(2rem,5vw,3.6rem) "DM Serif Display",serif; }
.document-card h2 { margin: 30px 0 8px; font-size: 1.15rem; }
.document-card p { line-height: 1.75; }
.legal-copy a { color: var(--primary); text-decoration: underline; }


/* v0.3 display preferences */
.settings-section { padding: 22px; margin-bottom: 18px; }
.settings-section-head { display:flex; align-items:center; gap:13px; margin-bottom:20px; padding-bottom:15px; border-bottom:2px solid var(--line); }
.settings-section-head h2 { margin:0; }
.settings-section-head p { margin:3px 0 0; color:var(--muted); }
.settings-pixel-icon { width:48px; height:48px; display:grid; place-items:center; border:2px solid var(--line); background:var(--primary-soft); border-radius:10px; }
.settings-pixel-icon img { width:34px; height:34px; object-fit:contain; image-rendering:pixelated; }
.settings-form select { width:100%; border:1px solid var(--line); background:var(--surface-2); border-radius:11px; padding:11px 12px; outline:none; }
.settings-form label > small { color:var(--muted); font-weight:600; line-height:1.45; }
.preferences-form { max-width:760px; }
.font-size-setting { display:grid; gap:10px; margin:18px 0; }
.font-size-label { display:flex; justify-content:space-between; align-items:center; font-weight:800; }
.font-size-label strong { font-family:"Silkscreen",monospace; color:var(--primary); }
.font-size-controls { display:grid; grid-template-columns:auto minmax(180px,1fr) auto auto; gap:10px; align-items:center; }
.font-size-controls input[type="range"] { width:100%; accent-color:var(--primary); }
.font-step { min-width:52px; padding-inline:10px; }
.inline-reset { width:auto; margin:0; padding:8px; }
.font-preview { --preview-scale:1; display:flex; align-items:center; gap:14px; min-height:92px; margin:16px 0 20px; padding:14px; border:2px solid var(--line); border-radius:11px; background-image:url("menu-bg.png"); background-size:250px 150px; overflow:hidden; }
.font-preview img { width:56px; height:56px; object-fit:contain; image-rendering:pixelated; }
.font-preview span { display:grid; gap:4px; font-size:calc(1rem * var(--preview-scale)); transform-origin:left center; }
.font-preview small { color:var(--muted); }
.preference-check { display:flex !important; grid-template-columns:none !important; align-items:center; justify-content:space-between; gap:18px; padding:14px; border:2px solid var(--line); border-radius:11px; background:var(--surface-2); }
.preference-check span { display:grid; gap:3px; }
.preference-check input { width:20px !important; height:20px; accent-color:var(--primary); }
.settings-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:18px; }

@media(max-width:620px){
  .font-size-controls{grid-template-columns:auto 1fr auto}.font-size-controls .inline-reset{grid-column:1/-1;justify-self:start}
}

/* v0.4.0 profile, permissions, messages, and moderation */
.permission-badge { display:inline-flex; align-items:center; gap:5px; width:fit-content; border-radius:999px; padding:5px 9px; font-size:.72rem; font-weight:900; border:1px solid var(--line); }
.permission-badge .icon { width:15px; height:15px; }
.permission-badge.owner { background:color-mix(in srgb,#f2c04f 28%,var(--surface)); color:color-mix(in srgb,#9b6200 80%,var(--text)); border-color:#d79c45; }
.permission-badge.moderator { background:color-mix(in srgb,#7da6d8 25%,var(--surface)); color:color-mix(in srgb,#31577f 80%,var(--text)); border-color:#7396bd; }
.permission-badge.user { background:var(--surface-3); color:var(--muted); }
:root[data-mode="dark"] .permission-badge.owner { color:#ffe5a0; }
:root[data-mode="dark"] .permission-badge.moderator { color:#c8e1ff; }

.profile-media-settings { display:grid; grid-template-columns:minmax(180px,.8fr) minmax(280px,1.6fr); gap:18px; padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--surface-2); }
.profile-image-setting,.profile-cover-setting { display:grid; align-content:start; gap:10px; }
.profile-image-preview { --avatar-size:110px; justify-self:start; background:var(--primary-soft); }
.profile-media-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.file-button { cursor:pointer; }
.file-button input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.cover-preview { height:150px; border:2px dashed var(--line); border-radius:12px; background-image:linear-gradient(110deg,rgba(14,50,40,.3),rgba(10,30,44,.12)),url("header-forest.png"); background-size:cover; background-position:center; }
.cover-preview.has-image { border-style:solid; }
.profile-media-settings small { color:var(--muted); }

.sidebar-message-panel { margin-top:12px; padding:10px; display:grid; grid-template-rows:auto auto minmax(0,1fr); min-height:270px; max-height:calc(100vh - var(--topbar) - 330px); overflow:hidden; }
.sidebar-message-panel.hidden { display:none; }
.sidebar-message-head { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:2px 3px 8px; }
.sidebar-thread-search { margin:0 0 8px; }
.sidebar-thread-list { min-height:0; max-height:100%; overflow-y:auto; scrollbar-width:thin; padding:0; }
.sidebar-thread-list .thread-row { padding:8px 6px; }
.sidebar-empty { padding:18px 8px; }
.messages-center { height:calc(100vh - var(--topbar) - 36px); min-height:610px; overflow:hidden; }
.messages-center .chat-column { height:100%; }
.messages-center .empty-card .primary-button { margin:16px auto 0; }

.moderation-section { padding:20px; margin-bottom:14px; }
.moderation-search { display:flex; align-items:flex-end; gap:10px; margin-bottom:14px; }
.moderation-search label { flex:1; display:flex; align-items:center; gap:8px; border:1px solid var(--line); background:var(--surface-3); border-radius:10px; padding:9px 11px; }
.moderation-search input { flex:1; min-width:0; border:0; outline:0; background:transparent; }
.moderation-results,.report-list { display:grid; gap:9px; }
.moderation-user-card,.report-card { display:flex; align-items:center; gap:12px; padding:12px; border:1px solid var(--line); border-radius:11px; background:var(--surface-2); }
.moderation-user-copy { flex:1; min-width:0; display:grid; gap:3px; }
.moderation-user-copy small,.report-card small { color:var(--muted); overflow-wrap:anywhere; }
.moderation-user-copy .profile-badges { margin-top:5px; }
.role-control { min-width:150px; }
.role-control select { width:100%; margin-top:4px; }
.report-card { align-items:flex-start; justify-content:space-between; }
.report-card > div:first-child { min-width:0; }
.report-card p { margin:7px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; }
.report-actions { display:flex; gap:7px; flex-wrap:wrap; justify-content:flex-end; }
.danger-button.small { min-height:34px; padding:7px 10px; font-size:.72rem; }

@media (max-width:1000px) {
  .sidebar-message-panel { display:none !important; }
}
@media (max-width:700px) {
  .profile-media-settings { grid-template-columns:1fr; }
  .moderation-search,.moderation-user-card,.report-card { align-items:stretch; flex-direction:column; }
  .role-control { width:100%; }
  .report-actions { justify-content:flex-start; }
}

/* v0.4.0 character portrait correction
   Game sprites must remain fully visible and pixel-crisp. Custom profile photos keep cover cropping. */
.avatar.game-avatar {
  background: linear-gradient(145deg, var(--primary-soft), var(--accent-soft));
}
.avatar.game-avatar img {
  object-fit: contain;
  image-rendering: pixelated;
  padding: 5%;
  box-sizing: border-box;
}
.avatar-xl.game-avatar img { padding: 8%; }
.moderation-user-actions { display:grid; justify-items:stretch; gap:8px; min-width:160px; }
.moderation-user-actions .secondary-button { justify-content:center; }
@media (max-width:700px) { .moderation-user-actions { width:100%; min-width:0; } }


/* v0.5.0 Facebook/X-style post interactions */
.post-body,.embedded-post-body,.comment-bubble p { white-space: pre-wrap; overflow-wrap: anywhere; }
.post-media-button { width: 100%; border: 0; border-block: 1px solid var(--line); padding: 0; background: color-mix(in srgb,var(--surface-3) 86%,#000); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.post-media-button .post-media { width: auto; height: auto; max-width: 100%; max-height: min(680px,72vh); object-fit: contain; border: 0; image-rendering: auto; }
.post-media-button.media-square { max-width: 560px; margin-inline: auto; border-inline: 1px solid var(--line); }
.post-media-button.media-portrait { max-width: 520px; margin-inline: auto; border-inline: 1px solid var(--line); }
.post-media-button.embedded { max-height: 420px; border: 0; border-top: 1px solid var(--line); }
.post-media-button.embedded .post-media { max-height: 420px; }
.post-summary { align-items: center; }
.summary-link { border: 0; background: transparent; color: inherit; padding: 3px 0; font: inherit; cursor: pointer; }
.summary-link:hover { text-decoration: underline; color: var(--text); }
.post-actions button.active .icon { fill: currentColor; stroke: currentColor; }
.post-actions button:disabled { opacity: .65; cursor: wait; }
.share-action-wrap { position: relative; display: flex; }
.share-action-wrap > button { width: 100%; }
.share-menu { position: absolute; right: 6px; bottom: calc(100% + 7px); width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); z-index: 35; }
.share-menu button { width: 100%; justify-content: flex-start; padding: 9px 10px; }
.view-more-comments { border: 0; background: transparent; padding: 0 0 8px; color: var(--muted); font-weight: 800; text-align: left; cursor: pointer; }
.view-more-comments:hover { text-decoration: underline; }
.comment-bubble small { display: block; margin-top: 4px; color: var(--muted); font-size: .66rem; }
.detail-comments { max-height: min(620px,62vh); overflow-y: auto; scrollbar-gutter: stable; }
.post-detail-tabs { display: flex; gap: 8px; margin-bottom: 12px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.post-detail-tabs a { flex: 1; padding: 9px 12px; border-radius: 8px; text-align: center; color: var(--muted); font-weight: 800; }
.post-detail-tabs a.active,.post-detail-tabs a:hover { color: var(--text); background: var(--surface-3); }
.post-detail-panel { padding: 0; overflow: hidden; }
.post-detail-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.post-detail-panel-head h2 { margin: 0; }
.reaction-member-list { max-height: min(620px,62vh); overflow-y: auto; padding: 8px; scrollbar-gutter: stable; }
.reaction-member { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 9px; border-radius: 10px; }
.reaction-member:hover { background: var(--surface-3); }
.reaction-member span:nth-child(2) { display: grid; gap: 2px; }
.reaction-member small { color: var(--muted); }
.reaction-heart { color: var(--primary); }
.reaction-heart .icon { fill: currentColor; }
.embedded-post { margin: 0 14px 14px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--surface-2); }
.embedded-post-head { display: flex; align-items: center; gap: 9px; padding: 11px 12px; color: var(--text); }
.embedded-post-head span:nth-child(2) { display: grid; }
.embedded-post-head small { color: var(--muted); }
.embedded-post-body { padding: 0 12px 12px; }
.embedded-post.unavailable { padding: 16px; color: var(--muted); }
.avatar-tiny { width: 34px; height: 34px; }
.image-lightbox-backdrop { background: rgba(0,0,0,.88); padding: 12px; }
.image-lightbox { width: min(1500px,100%); height: min(94vh,1100px); display: grid; grid-template-rows: auto 1fr; background: #090b0a; border: 1px solid rgba(255,255,255,.18); border-radius: 14px; overflow: hidden; }
.image-lightbox > header { display: flex; justify-content: flex-end; gap: 10px; padding: 8px; background: rgba(10,14,12,.94); }
.image-lightbox-stage { min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; }
.image-lightbox-stage img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; image-rendering: auto; }
@media (max-width:700px) {
  .post-media-button.media-square,.post-media-button.media-portrait { max-width: 100%; border-inline: 0; }
  .image-lightbox-backdrop { padding: 0; }
  .image-lightbox { height: 100dvh; border-radius: 0; border: 0; }
}
.post-actions button[data-react].active { color: #e26b78; }

/* v0.5.2 exact game-avatar rendering — retained after user stylesheet merge.
   The game portrait is a 20x30 two-layer sprite. Never crop or square-resize it. */
.avatar.game-avatar img,
.character-art img[src*="/community-character-assets/"],
.character-art img[src*="community-character-assets/"] {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  padding: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.avatar-xl.game-avatar img { padding: 0; }


/* v0.5.4: Main badge text colors */
.main-character-label { color: var(--text) !important; }
:root[data-mode="dark"] .main-character-label { color: #fff !important; }

/* v0.6.1 public profile navigation */
.profile-identity-link { color: inherit; text-decoration: none; }
.profile-identity-link:hover strong { text-decoration: underline; text-underline-offset: 2px; }
.profile-avatar-link { display: inline-flex; flex: 0 0 auto; border-radius: 10px; }
.profile-avatar-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.embedded-post-date { color: var(--muted); text-decoration: none; }
.embedded-post-date:hover { text-decoration: underline; }
.reaction-member-link { color: inherit; text-decoration: none; }
.public-profile-identity { display: block; margin-top: 4px; color: var(--muted); }

/* v0.6.2 profile discovery + safe rich-text hyperlinks */
.rich-text-link { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; overflow-wrap: anywhere; word-break: break-word; }
.rich-text-link:hover { color: var(--accent); }
.message-row.mine .rich-text-link { color: inherit; }
.member-profile-copy:hover strong, .member-result-copy:hover strong, .friend-row-profile:hover strong { text-decoration: underline; text-underline-offset: 2px; }
.member-profile-copy:focus-visible, .member-result-copy:focus-visible, .friend-row-profile:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }


/* v0.6.4 public-profile relationship parity */
.public-profile-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; margin-left:auto; position:relative; }
.public-profile-relationship-wrap,.public-profile-menu-wrap { position:relative; }
.public-profile-actions .secondary-button { margin-left:0 !important; }
.public-profile-actions .icon-button { border:1px solid var(--line); background:var(--surface-3); color:var(--text); }
.public-profile-menu { top:calc(100% + 7px); right:0; min-width:210px; }
.public-profile-relationship-wrap .public-profile-menu { left:0; right:auto; }
.public-relationship-button { white-space:nowrap; }
.friend-check { display:inline-block; margin-left:6px; font-size:1em; line-height:1; font-weight:1000; }
.modal-help { margin:0 0 12px; color:var(--muted); font-size:.82rem; line-height:1.5; }
@media (max-width:700px) {
  .public-profile-actions { width:100%; justify-content:flex-start; margin-left:0; }
  .public-profile-relationship-wrap .public-profile-menu { left:0; right:auto; }
}

/* v0.6.5 public-profile popup stacking fix
   Relationship/profile action menus must escape the profile card and render above later sections. */
.profile-card {
  overflow: visible;
  position: relative;
}
.profile-card .profile-cover {
  border-radius: var(--radius) var(--radius) 0 0;
}
.public-profile-actions,
.public-profile-relationship-wrap,
.public-profile-menu-wrap {
  z-index: 80;
}
.public-profile-menu {
  z-index: 260 !important;
}
