:root {
  --ink: #4b3f48;
  --ink-soft: #8c7c88;
  --ink-faint: #b9aab4;
  --pink: #f4b6c8;
  --pink-deep: #e2849f;
  --rose: #f9d9e2;
  --mint: #bfe6d8;
  --peach: #ffdcc6;
  --card: rgba(255, 255, 255, 0.78);
  --line: rgba(226, 132, 159, 0.16);
  --shadow: 0 10px 40px -12px rgba(214, 120, 150, 0.32), 0 2px 8px -2px rgba(214, 120, 150, 0.12);
  --radius: 24px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Outfit', system-ui, sans-serif; font-weight: 300; color: var(--ink); background: #fdf3f6; min-height: 100dvh;
  -webkit-font-smoothing: antialiased; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(160deg, #fdf0f4 0%, #fbf4f1 45%, #eef8f4 100%); }
.bg span { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: drift 26s ease-in-out infinite alternate; }
.bg span:nth-child(1) { width: 420px; height: 420px; background: var(--pink); top: -120px; left: -100px; }
.bg span:nth-child(2) { width: 380px; height: 380px; background: var(--mint); bottom: -120px; right: -80px; animation-delay: -8s; }
.bg span:nth-child(3) { width: 300px; height: 300px; background: var(--peach); top: 40%; left: 55%; animation-delay: -16s; opacity: .4; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }

.top { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); background: rgba(253, 243, 246, 0.72); border-bottom: 1px solid var(--line); }
.top .inner { max-width: 560px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-weight: 500; font-size: 22px; letter-spacing: .02em; display: flex; align-items: center; gap: 6px; }
.brand .st { color: var(--pink-deep); font-size: 18px; }
.mychip { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); }
.mychip b { font-weight: 400; font-size: 18px; letter-spacing: .02em; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: center; gap: 6px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(253, 243, 246, 0.82); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabs a { flex: 1; max-width: 160px; text-align: center; padding: 10px 0; border-radius: 16px; font-weight: 400; color: var(--ink-soft); transition: .2s; }
.tabs a.on { background: #fff; color: var(--pink-deep); box-shadow: var(--shadow); }
.tabs a span { display: block; font-size: 18px; line-height: 1; margin-bottom: 2px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 16px 0;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.7); }
h1, h2, h3 { font-weight: 300; margin: 0; }
h2 { font-size: 15px; font-weight: 400; color: var(--ink-soft); letter-spacing: .08em; text-transform: uppercase; margin: 26px 4px 6px; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.small { font-size: 13px; }

.av { --s: 44px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 400; font-size: calc(var(--s) * .38);
  color: #fff; background-size: cover; background-position: center; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ring, var(--rose)); }
.av.sm { --s: 30px; box-shadow: 0 0 0 2px #fff; }
.av.xl { --s: 132px; box-shadow: 0 0 0 5px #fff, 0 0 0 9px var(--ring, var(--rose)), 0 24px 60px -18px rgba(214,120,150,.55); }

.score { display: inline-flex; align-items: baseline; gap: 3px; padding: 3px 10px; border-radius: 999px; font-weight: 400; font-size: 14px;
  background: var(--tier-bg, var(--rose)); color: var(--tier-ink, var(--ink)); white-space: nowrap; }
.score i { font-style: normal; font-size: .8em; opacity: .8; }
.t-prime { --tier-bg: linear-gradient(120deg, #ffe3b0, #f8c4d4); --tier-ink: #8a5a3c; --ring: #f6cf8e; }
.t-high { --tier-bg: linear-gradient(120deg, #fbd3df, #f4b6c8); --tier-ink: #8f4560; --ring: #f4b6c8; }
.t-mid { --tier-bg: linear-gradient(120deg, #d8f0e7, #bfe6d8); --tier-ink: #3f7564; --ring: #bfe6d8; }
.t-low { --tier-bg: #ece6ea; --tier-ink: #85757f; --ring: #dcd2d8; }
.t-flag { --tier-bg: #e4dfe2; --tier-ink: #6f6369; --ring: #c9c0c5; }

.post { display: grid; grid-template-columns: auto 1fr; gap: 12px; }
.post .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post .name { font-weight: 400; }
.post .txt { margin: 6px 0 10px; font-size: 17px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.post .rateline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.stars { display: inline-flex; gap: 2px; }
.stars button { border: 0; background: none; padding: 2px; cursor: pointer; font-size: 26px; line-height: 1; color: #ecdde4; transition: transform .15s, color .15s; }
.stars.big button { font-size: 44px; padding: 4px; }
.stars button.on { color: var(--pink-deep); }
.stars button:hover { transform: scale(1.18); }
.stars[aria-disabled="true"] button { cursor: default; }
.stars[aria-disabled="true"] button:hover { transform: none; }
.burst { position: fixed; pointer-events: none; z-index: 50; font-size: 22px; color: var(--pink-deep); animation: burst .9s ease-out forwards; }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; } }

.btn { border: 0; border-radius: 999px; padding: 11px 22px; font-weight: 400; cursor: pointer; transition: .2s;
  background: linear-gradient(120deg, #f6bccd, #e2849f); color: #fff; box-shadow: 0 8px 22px -8px rgba(226,132,159,.8); }
.btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.ghost { background: #fff; color: var(--pink-deep); box-shadow: var(--shadow); }
.btn.block { width: 100%; padding: 14px; font-size: 17px; }
.field { display: block; margin: 12px 0; }
.field span { display: block; font-size: 13px; color: var(--ink-soft); margin: 0 4px 6px; letter-spacing: .04em; }
.field input, .field textarea { width: 100%; padding: 13px 16px; border-radius: 16px; border: 1px solid var(--line); background: #fff; outline: none; font-size: 16px; }
.field input:focus, .field textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(244,182,200,.25); }
.err { color: #c0567a; font-size: 14px; min-height: 20px; margin: 4px; }

.hero { text-align: center; padding: 48px 8px 8px; }
.hero .big { font-size: 96px; font-weight: 200; line-height: 1; letter-spacing: -.02em;
  background: linear-gradient(120deg, #e2849f, #f6cf8e 60%, #7cc4ab); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 { font-size: 34px; margin-top: 14px; }
.hero p { color: var(--ink-soft); font-size: 17px; max-width: 360px; margin: 10px auto 0; line-height: 1.5; }
.seg { display: flex; background: rgba(255,255,255,.6); border-radius: 999px; padding: 4px; margin-bottom: 6px; }
.seg button { flex: 1; border: 0; background: none; padding: 10px; border-radius: 999px; cursor: pointer; color: var(--ink-soft); }
.seg button.on { background: #fff; color: var(--pink-deep); box-shadow: var(--shadow); }

.person { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person .rank { width: 22px; text-align: center; color: var(--ink-faint); font-size: 14px; }
.person .who { flex: 1; min-width: 0; }
.person .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { width: 100%; padding: 13px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); outline: none; font-size: 16px; margin-top: 16px; }

.prof { text-align: center; padding-top: 30px; }
.prof .av.xl { margin: 0 auto; }
.prof .num { font-size: 84px; font-weight: 200; line-height: 1; margin-top: 22px; letter-spacing: -.02em; }
.prof .num small { font-size: 32px; color: var(--pink-deep); margin-left: 4px; }
.prof .tier { display: inline-block; margin-top: 10px; }
.prof .nm { font-size: 26px; margin-top: 14px; }
.prof .bio { color: var(--ink-soft); margin: 8px auto 0; max-width: 380px; line-height: 1.5; }
.ratebox { text-align: center; }
.dist { display: grid; gap: 6px; }
.dist .r { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.dist .bar { height: 8px; border-radius: 8px; background: #f3e7ec; overflow: hidden; }
.dist .bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #f6bccd, #e2849f); }
.incoming { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.incoming:last-child { border-bottom: 0; }
.incoming .s { margin-left: auto; color: var(--pink-deep); letter-spacing: 1px; }
.avatar-edit { display: flex; align-items: center; gap: 14px; }

.radar { text-align: center; padding: 26px 20px 22px; }
.radar h3 { font-size: 24px; margin-top: 14px; }
.radar p { margin: 8px auto 16px; max-width: 360px; line-height: 1.5; }
.pulse { position: relative; width: 96px; height: 96px; margin: 0 auto; display: grid; place-items: center; }
.pulse b { position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 300;
  color: #fff; background: linear-gradient(140deg, #f6bccd, #e2849f); box-shadow: 0 12px 30px -10px rgba(226,132,159,.9); }
.pulse span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--pink); opacity: 0; }
.radar.on .pulse span { animation: ping 2.4s ease-out infinite; }
.radar.on .pulse span:nth-child(2) { animation-delay: 1.2s; }
.radar:not(.on) .pulse b { background: linear-gradient(140deg, #e9dde3, #cdbcc5); box-shadow: none; }
@keyframes ping { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; background: #fff; padding: 12px 20px;
  border-radius: 999px; box-shadow: var(--shadow); transition: .3s; z-index: 60; font-weight: 400; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { text-align: center; font-size: 40px; color: var(--pink); padding: 120px 0; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.9); } }
.empty { text-align: center; padding: 30px 10px; color: var(--ink-soft); }
.rise { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) { *, .bg span { animation: none !important; transition: none !important; } }
