:root {
  --bg: #faf9ff;
  --surface: #ffffff;
  --surface-2: #f2effb;
  --text: #19142b;
  --muted: #5b5672;
  --border: #e3ddf2;
  --accent: #6d28d9;
  --accent-2: #db2777;
  --accent-soft: #ede7fe;
  --on-accent: #ffffff;
  --ok: #157f3b;
  --warn: #a35a00;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(25, 20, 43, .05), 0 6px 20px rgba(25, 20, 43, .06);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-styled: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Math", "Cambria Math", "STIX Two Math",
    "Segoe UI Symbol", "Noto Sans Symbols", "Noto Sans Symbols 2", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0b18;
    --surface: #161226;
    --surface-2: #1f1934;
    --text: #f1edfb;
    --muted: #aaa3c4;
    --border: #2d2546;
    --accent: #b49cfb;
    --accent-2: #f472b6;
    --accent-soft: #2a2148;
    --on-accent: #120d22;
    --ok: #4ade80;
    --warn: #fbbf24;
    --danger: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0b18;
  --surface: #161226;
  --surface-2: #1f1934;
  --text: #f1edfb;
  --muted: #aaa3c4;
  --border: #2d2546;
  --accent: #b49cfb;
  --accent-2: #f472b6;
  --accent-soft: #2a2148;
  --on-accent: #120d22;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  overflow-x: hidden;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.wrap { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 58px; max-width: 1080px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; font-size: 1rem; font-family: var(--font-styled); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-links { display: none; gap: 2px; }
.nav-links a { padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: .95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--surface-2); }
.menu, .langs { position: relative; }
.menu > summary, .langs > summary { list-style: none; cursor: pointer; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: .92rem; display: flex; align-items: center; gap: 6px; min-height: 40px; }
.menu > summary::-webkit-details-marker, .langs > summary::-webkit-details-marker { display: none; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 210px; display: grid; z-index: 30; max-height: 70vh; overflow: auto; }
.dropdown a { padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.dropdown a:hover, .dropdown a[aria-current="page"] { background: var(--surface-2); }
@media (min-width: 900px) {
  .nav-links { display: flex; }
  .menu { display: none; }
}
/* Very small phones (320 px): the menu keeps its icon and its name stays readable by screen readers. */
@media (max-width: 359.98px) {
  .site-header .wrap { gap: 8px; }
  .menu > summary, .langs > summary { padding: 8px 10px; }
  .menu > summary span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Hero and tool */
main { padding-bottom: 40px; }
.hero { padding: 26px 0 8px; }
.hero h1 { font-size: clamp(1.6rem, 4.4vw, 2.3rem); line-height: 1.15; margin: 0 0 10px; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.tool { margin-top: 18px; }
.input-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.input-card label { display: block; font-weight: 650; font-size: .9rem; margin-bottom: 6px; }
.input-row { display: flex; gap: 8px; align-items: stretch; }
textarea { width: 100%; min-height: 64px; resize: vertical; border: 1px solid var(--border); border-radius: 11px; padding: 12px; background: var(--bg); color: var(--text); font: 1.1rem/1.4 var(--font); }
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn { border: 1px solid var(--border); background: var(--surface-2); border-radius: 11px; padding: 0 14px; cursor: pointer; font-size: .92rem; min-height: 44px; }
.btn:hover { border-color: var(--accent); }
.hint { margin: 8px 2px 0; font-size: .85rem; color: var(--muted); }
.frames { margin-top: 12px; }
.frames-label { font-size: .85rem; font-weight: 650; color: var(--muted); display: block; margin-bottom: 6px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip { flex: 0 0 auto; border: 1px solid var(--border); background: var(--bg); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-family: var(--font-styled); font-size: .95rem; min-height: 38px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Style list */
.list-title, .group-title { font-size: 1rem; margin: 22px 2px 10px; color: var(--muted); font-weight: 700; text-transform: none; }
.styles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.style-btn { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name copy" "out copy"; align-items: center; gap: 2px 12px; padding: 11px 12px 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, transform .05s; }
.style-btn:hover { border-color: var(--accent); }
.style-btn:active { transform: scale(.995); }
.style-name { grid-area: name; font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.style-warn { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--warn); color: var(--surface); font-size: .7rem; font-weight: 800; }
.style-out { grid-area: out; font-family: var(--font-styled); font-size: 1.28rem; line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; white-space: pre-wrap; min-height: 1.45em; }
.style-copy { grid-area: copy; font-size: .85rem; font-weight: 650; padding: 8px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.style-btn.is-copied .style-copy { background: var(--ok); color: #fff; }
.style.is-selected .style-btn { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.show-all { width: 100%; margin-top: 14px; min-height: 48px; font-weight: 650; }
.more-link { display: block; margin-top: 14px; text-align: center; }

/* Preview cards */
.preview { margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); padding: 14px; }
.preview-title { font-size: .85rem; color: var(--muted); font-weight: 650; margin: 0 0 10px; display: flex; justify-content: space-between; gap: 8px; }
.pv-counter { font-variant-numeric: tabular-nums; }
.pv-limit.is-over { color: var(--danger); font-weight: 750; }
.pv-over { color: var(--danger); font-size: .82rem; margin: 8px 0 0; }
.pv-styled { font-family: var(--font-styled); overflow-wrap: anywhere; }
.pv-profile { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; }
.pv-avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, #f59e0b, #ec4899 55%, #8b5cf6); padding: 3px; }
.pv-avatar::after { content: ""; display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--surface-2); border: 3px solid var(--surface); }
.pv-stats { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); }
.pv-stats b { color: var(--text); display: block; font-size: 1rem; }
.pv-user { font-weight: 700; font-size: .95rem; }
.pv-name { font-size: 1.05rem; margin-top: 10px; font-weight: 600; }
.pv-bio { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.pv-tiktok { text-align: center; }
.pv-tiktok .pv-avatar { margin: 0 auto 8px; background: linear-gradient(135deg, #25f4ee, #fe2c55); }
.pv-tiktok .pv-stats { justify-content: center; margin-top: 8px; }
.pv-ff { background: linear-gradient(180deg, #2b1d10, #120c06); color: #ffe7b0; border-radius: 12px; padding: 14px; display: flex; align-items: center; gap: 12px; }
.pv-ff-badge { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, #f59e0b, #b45309); display: grid; place-items: center; font-weight: 800; color: #1a1205; font-size: .8rem; text-align: center; line-height: 1.1; }
.pv-ff-nick { font-size: 1.25rem; font-weight: 700; color: #fff7e0; text-shadow: 0 1px 0 #000; }
.pv-discord { background: #232428; color: #f2f3f5; border-radius: 12px; overflow: hidden; }
.pv-discord-banner { height: 46px; background: linear-gradient(90deg, #5865f2, #eb459e); }
.pv-discord-body { padding: 0 14px 14px; }
.pv-discord .pv-avatar { width: 58px; height: 58px; margin-top: -26px; background: #5865f2; }
.pv-discord .pv-avatar::after { background: #313338; border-color: #232428; }
.pv-discord-name { font-size: 1.2rem; font-weight: 700; margin-top: 6px; }
.pv-discord-tag { color: #b5bac1; font-size: .85rem; }
.pv-discord-about { margin-top: 10px; border-top: 1px solid #3f4147; padding-top: 8px; font-size: .85rem; color: #dbdee1; }
.pv-discord-about b { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #b5bac1; margin-bottom: 2px; }
.pv-wa { background: #efeae2; border-radius: 12px; padding: 14px; }
.pv-wa-bubble { margin-left: auto; max-width: 88%; background: #d9fdd3; color: #111b21; border-radius: 10px 0 10px 10px; padding: 8px 10px 6px; font-size: .98rem; line-height: 1.45; box-shadow: 0 1px .5px rgba(11, 20, 26, .13); overflow-wrap: anywhere; font-family: var(--font-styled); }
.pv-wa-time { display: block; text-align: right; font-size: .7rem; color: #667781; margin-top: 2px; }
.pv-wa-bubble code { font-family: ui-monospace, Menlo, Consolas, monospace; background: rgba(0, 0, 0, .06); padding: 0 4px; border-radius: 4px; }
.wa-mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.wa-quote { display: block; border-left: 3px solid #25d366; padding-left: 8px; color: #3b4a54; }
.wa-li { display: block; }

/* Content */
.content { margin-top: 34px; }
.content h2 { font-size: 1.3rem; line-height: 1.3; margin: 28px 0 10px; letter-spacing: -.01em; }
.content p { margin: 0 0 12px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding: 12px 14px 12px 50px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.steps li::before { content: counter(step); position: absolute; left: 12px; top: 11px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 13px 0; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 800; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 13px; color: var(--muted); }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.related a { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 600; }
.related a:hover { border-color: var(--accent); }
.privacy-note { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; color: var(--muted); margin-top: 18px; }

/* Symbols and invisible characters */
.sym-group { margin-top: 22px; }
.sym-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.sym-head h2 { margin: 0; font-size: 1.1rem; }
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.sym-grid.is-wide { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sym { min-height: 52px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; cursor: pointer; font-family: var(--font-styled); font-size: 1.35rem; line-height: 1.2; padding: 6px; overflow-wrap: anywhere; }
.sym-grid.is-wide .sym { font-size: 1rem; }
.sym:hover { border-color: var(--accent); }
.sym.is-copied { background: var(--ok); color: #fff; border-color: var(--ok); }
.invis-list { display: grid; gap: 10px; }
.invis { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.invis h2 { margin: 0; font-size: 1.02rem; }
.invis p { margin: 0; color: var(--muted); font-size: .9rem; grid-column: 1; }
.invis .btn { grid-row: 1 / span 2; grid-column: 2; background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.invis .btn.is-copied { background: var(--ok); border-color: var(--ok); color: #fff; }
.invis-box { display: inline-block; min-width: 1.4em; border: 1px dashed var(--muted); border-radius: 4px; margin-left: 6px; text-align: center; }
.tester { margin-top: 12px; }
.tester-msg { font-weight: 650; margin: 10px 0 6px; }
.tester-list { margin: 0; padding-left: 18px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88rem; }

/* Character counter */
.counter-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; min-width: 0; }
.stat-n { font-size: 1.6rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-l { font-size: .82rem; color: var(--muted); }
.limits { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.limit { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.limit-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.limit-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.limit-bar i { display: block; width: 0; height: 100%; background: var(--accent); border-radius: inherit; transition: width .15s; }
.limit.is-over .limit-n { color: var(--danger); }
.limit.is-over .limit-bar i { background: var(--danger); }

/* Static pages */
.prose { max-width: 680px; overflow-wrap: anywhere; }
.prose h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin: 26px 0 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0 40px; background: var(--surface); font-size: .92rem; }
.site-footer .wrap { max-width: 1080px; }
.foot-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .foot-grid { grid-template-columns: 1.3fr 2fr 1fr 1fr; } }
.foot-grid h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-tools ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.foot-grid a { color: var(--text); text-decoration: none; }
.foot-grid a:hover { color: var(--accent); text-decoration: underline; }
.foot-brand p { color: var(--muted); margin: 8px 0 0; }
.foot-brand .foot-sisters-title { margin-top: 18px; }
.foot-sisters li { display: grid; gap: 0; }
.foot-sisters a { font-weight: 700; }
.foot-sisters span { color: var(--muted); font-size: .86rem; }
.copyright { color: var(--muted); margin-top: 22px; font-size: .85rem; }

/* Toast, language bar, back to top */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.lang-bar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 44px 8px 16px; background: var(--accent-soft); color: var(--text); font-size: .9rem; position: relative; flex-wrap: wrap; }
.lang-bar-go { font-weight: 700; }
.lang-bar-close { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 1.4rem; cursor: pointer; width: 36px; height: 36px; }
.to-top { display: inline-block; margin-top: 24px; font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Nickname generator ---------- */
.nick-form { display: grid; gap: 10px; }
.nick-row { display: flex; gap: 8px; }
.nick-row input { flex: 1; width: 0; min-width: 0; min-height: 48px; font-size: 1.05rem; border: 2px solid var(--border); border-radius: 12px; padding: 0 14px; background: var(--bg); color: var(--text); }
.nick-row input:focus { outline: none; border-color: var(--accent); }
.nick-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.nick-item { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.nick-text { flex: 1; min-width: 0; font-size: 1.25rem; overflow-wrap: anywhere; }
.nick-len { font-size: .8rem; color: var(--muted); white-space: nowrap; }
