/* Display-name styles ("Name style" in Settings → Profile).
 *
 * Fonts: curated, OFL-licensed, self-hosted (public/assets/fonts, see OFL.txt).
 * Neutral dn-* family names keep them independent of locally installed copies.
 * Each family is split into Latin + Latin Extended files by unicode-range, and
 * nothing references a family until an element carries data-name-font, so a
 * browser only downloads a file when a name using that font (and that script
 * range, e.g. ğ/ş/İ for latin-ext) is actually rendered.
 * One static weight per family, declared for the whole 100–900 range so bold
 * name styles never trigger faux-bold synthesis.
 *
 * Ids must match server/nameStyle.js (NAME_FONT_IDS) and NAME_FONTS in app.js.
 * Colour is applied inline by applyNameStyle() after readableNameColor() has
 * adjusted it for the active theme background. */
@font-face { font-family: "dn-serif"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/playfair-display-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "dn-serif"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/playfair-display-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "dn-mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "dn-mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "dn-hand"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/caveat-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "dn-hand"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/caveat-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "dn-script"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/pacifico-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "dn-script"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/pacifico-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "dn-rounded"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/comfortaa-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "dn-rounded"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/comfortaa-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "dn-condensed"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/oswald-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "dn-condensed"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/oswald-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "dn-pixel"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/pixelify-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "dn-pixel"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/pixelify-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "dn-gothic"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/grenze-gotisch-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "dn-gothic"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/grenze-gotisch-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "dn-tech"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/audiowide-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "dn-tech"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/assets/fonts/audiowide-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* The families have very different x-heights (Caveat/Grenze Gotisch read ~25%
   smaller than the UI font at the same size); normalise them to the UI font's
   x-height so a styled name never shrinks or balloons next to others. Engines
   without font-size-adjust simply render at the nominal size. */
[data-name-font] { font-size-adjust: 0.53; }
[data-name-font="serif"] { font-family: "dn-serif", Georgia, serif; }
[data-name-font="mono"] { font-family: "dn-mono", ui-monospace, monospace; }
[data-name-font="hand"] { font-family: "dn-hand", cursive; }
[data-name-font="script"] { font-family: "dn-script", cursive; }
[data-name-font="rounded"] { font-family: "dn-rounded", sans-serif; }
[data-name-font="condensed"] { font-family: "dn-condensed", "Arial Narrow", sans-serif; }
[data-name-font="pixel"] { font-family: "dn-pixel", monospace; }
[data-name-font="gothic"] { font-family: "dn-gothic", serif; }
[data-name-font="tech"] { font-family: "dn-tech", sans-serif; }

/* Chrome that sits inside a styled name keeps the UI font. */
[data-name-font] .bot-badge { font-family: "Inter", "gg sans", "Helvetica Neue", Helvetica, Arial, sans-serif; }

/* ── Settings → Profile → Name style editor ── */
.ns-editor { display: grid; gap: 10px; margin: 0 0 8px; min-width: 0; }
.ns-hint { margin: 0; font-size: 13px; }
.ns-label { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ns-preview {
  display: flex; align-items: flex-start; gap: 10px; min-width: 0;
  padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
}
.ns-preview .avatar { flex: 0 0 auto; }
.ns-preview-body { min-width: 0; }
.ns-preview-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.ns-preview-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; color: var(--text-bright); }
.ns-preview-time { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.ns-preview-text { font-size: 14px; color: var(--text); }
.ns-font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.ns-font-cell {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; min-height: 56px;
  padding: 9px 12px; background: var(--bg-input); color: var(--text-bright); text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  transition: border-color var(--dur-ui) ease, background-color var(--dur-ui) ease;
}
.ns-font-cell:hover { background: var(--bg-input); border-color: var(--border-strong); }
.ns-font-cell.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-input)); }
.ns-font-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ns-font-sample { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; line-height: 1.4; }
.ns-font-label { font-size: 11px; font-weight: 500; color: var(--muted); }
.ns-swatches input[type="color"] {
  width: 34px; height: 34px; min-height: 0; padding: 3px; margin: 0;
  background: var(--bg-3); border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer;
}
.ns-swatches input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.ns-swatches input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
.ns-swatches input[type="color"]::-moz-color-swatch { border: 0; border-radius: 5px; }
.ns-swatches .accent-swatch[data-c="#ffffff"] { box-shadow: inset 0 0 0 1px var(--border-strong); }
:is(#settingsModalRoot, .mobile-settings-screen) .ns-swatches .accent-swatch { border-radius: 8px; }
.mobile-settings-screen .ns-swatches input[type="color"] { width: 40px; height: 40px; }
.ns-adjusted { margin: 0; font-size: 12px; }
.ns-actions { display: flex; }
@media (prefers-reduced-motion: reduce) { .ns-font-cell { transition: none; } }
