:root {
    --ink: #252a34;
    --ink-soft: rgba(37, 42, 52, 0.54);
    --ink-faint: rgba(37, 42, 52, 0.055);
    --muted: #687184;
    --paper: #edf2f8;
    --card: rgba(255, 255, 255, 0.74);
    --card-strong: rgba(255, 255, 255, 0.88);
    --surface: rgba(255, 255, 255, 0.92);
    --line: rgba(37, 42, 52, 0.16);
    --bar: rgba(248, 250, 254, 0.76);
    --error: #b3402f;
    --green: #4c8a62;
    --accent: #5964d7;
    --accent-strong: #424db5;
    --accent-soft: rgba(89, 100, 215, 0.12);
    --atmosphere-a: rgba(255, 255, 255, 0.3);
    --atmosphere-b: rgba(101, 119, 221, 0.16);
    --vignette: rgba(24, 34, 58, 0.14);
    --hand: "Segoe Print", "Ink Free", "Comic Sans MS", cursive;
    --hand-head: "Ink Free", "Segoe Print", "Comic Sans MS", cursive;
    --sans: "Trebuchet MS", "Segoe UI", sans-serif;
    --scrawl-lg: 24px;
    --scrawl-md: 16px;
    --scrawl-sm: 12px;
    --pencil-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        0 18px 46px rgba(35, 48, 84, 0.16),
        0 5px 14px rgba(35, 48, 84, 0.08);
    --pencil-shadow-hover:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        0 22px 56px rgba(35, 48, 84, 0.21),
        0 7px 18px rgba(35, 48, 84, 0.1);
    --control-shadow: 0 8px 20px rgba(35, 48, 84, 0.11);

    /* sky: defaults = clear day */
    --sky-top: #58a6e8;
    --sky-mid: #9ecdf3;
    --sky-bottom: #e8f4fd;
    --cloud: rgba(255, 255, 255, 0.92);
    --clouds-front: 0.3;
    --clouds-back: 0.18;
    --glow-color: rgba(255, 255, 255, 0.35);
    --glow-opacity: 0;
    --stars-opacity: 0;
    --birds-opacity: 0;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background-color: var(--paper);
    font-family: var(--sans);
}

/* ---------- sky ---------- */

.sky {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 58%, var(--sky-bottom) 100%);
}

.sky::before,
.sky::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.sky::before {
    inset: -18%;
    z-index: 3;
    background:
        radial-gradient(circle at 18% 30%, var(--atmosphere-a) 0, transparent 31%),
        radial-gradient(circle at 82% 64%, var(--atmosphere-b) 0, transparent 34%);
    filter: blur(24px);
    opacity: 0.76;
    animation: atmosphereDrift 28s ease-in-out infinite alternate;
}

.sky::after {
    inset: 0;
    z-index: 4;
    background:
        linear-gradient(112deg, transparent 28%, rgba(255, 255, 255, 0.09) 46%, transparent 64%),
        radial-gradient(ellipse at center, transparent 48%, var(--vignette) 100%);
    background-size: 190% 100%, 100% 100%;
    opacity: 0.58;
    animation: atmosphereSweep 42s linear infinite;
}

@keyframes atmosphereDrift {
    from { transform: translate3d(-3%, -1%, 0) scale(1.03); }
    to { transform: translate3d(4%, 2%, 0) scale(1.1); }
}

@keyframes atmosphereSweep {
    from { background-position: 130% 0, 0 0; }
    to { background-position: -90% 0, 0 0; }
}

.sky__layer {
    position: absolute;
    inset: 0;
}

.sky__gl {
    width: 100%;
    height: 100%;
}

/* когда работает WebGL-небо, CSS-облака и свечение не нужны */
.sky--gl .sky__clouds,
.sky--gl .sky__glow {
    display: none;
}

.sky__glow {
    opacity: var(--glow-opacity);
    background: radial-gradient(62% 48% at 50% 102%, var(--glow-color), transparent 72%);
    transition: opacity 3s ease;
}

.sky__clouds {
    background-repeat: repeat-x;
    transition: opacity 3s ease;
    animation: cloudDrift linear infinite;
}

.sky__clouds--front {
    opacity: var(--clouds-front);
    background-image:
        radial-gradient(340px 105px at 250px 24%, var(--cloud) 0%, transparent 68%),
        radial-gradient(230px 80px at 590px 42%, var(--cloud) 0%, transparent 70%),
        radial-gradient(430px 125px at 1030px 18%, var(--cloud) 0%, transparent 66%),
        radial-gradient(290px 95px at 1430px 50%, var(--cloud) 0%, transparent 70%);
    background-size: 1700px 100%;
    animation-duration: 280s;
}

.sky__clouds--back {
    opacity: var(--clouds-back);
    background-image:
        radial-gradient(240px 70px at 150px 34%, var(--cloud) 0%, transparent 70%),
        radial-gradient(190px 60px at 520px 14%, var(--cloud) 0%, transparent 72%),
        radial-gradient(280px 80px at 900px 46%, var(--cloud) 0%, transparent 70%),
        radial-gradient(210px 65px at 1300px 26%, var(--cloud) 0%, transparent 72%),
        radial-gradient(170px 55px at 1710px 58%, var(--cloud) 0%, transparent 74%);
    background-size: 1980px 100%;
    animation-duration: 460s;
}

@keyframes cloudDrift {
    from { background-position: 0 0; }
    to { background-position: -1980px 0; }
}

.sky__clouds--front {
    animation-name: cloudDriftFront;
}

@keyframes cloudDriftFront {
    from { background-position: 0 0; }
    to { background-position: -1700px 0; }
}

.sky__stars {
    opacity: var(--stars-opacity);
    background-image:
        radial-gradient(1.3px 1.3px at 24px 34px, rgba(255, 255, 255, 0.95), transparent),
        radial-gradient(1px 1px at 112px 142px, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(1.7px 1.7px at 196px 64px, rgba(255, 255, 255, 0.95), transparent),
        radial-gradient(1px 1px at 268px 188px, rgba(255, 255, 255, 0.65), transparent),
        radial-gradient(1.2px 1.2px at 334px 96px, rgba(255, 255, 255, 0.85), transparent);
    background-size: 380px 260px;
    transition: opacity 3s ease;
}

.sky__stars--twinkle {
    background-image:
        radial-gradient(1.1px 1.1px at 64px 210px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1.5px 1.5px at 158px 118px, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1px 1px at 244px 22px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1.3px 1.3px at 410px 158px, rgba(255, 255, 255, 0.85), transparent);
    background-size: 460px 300px;
    animation: twinkle 6s ease-in-out infinite alternate;
}

@keyframes twinkle {
    from { opacity: calc(var(--stars-opacity) * 0.35); }
    to { opacity: var(--stars-opacity); }
}

.sky__moon {
    opacity: var(--stars-opacity);
    background:
        radial-gradient(circle 30px at 82% 16%, #f2f5ff 0 28px, transparent 31px),
        radial-gradient(circle 96px at 82% 16%, rgba(214, 226, 255, 0.22), transparent 72%);
    transition: opacity 3s ease;
}

/* млечный путь — мягкая диагональная полоса, видна только ночью */
.sky__milkyway {
    opacity: var(--stars-opacity);
    background: linear-gradient(
        115deg,
        transparent 30%,
        rgba(190, 205, 255, 0.08) 42%,
        rgba(222, 232, 255, 0.14) 50%,
        rgba(190, 205, 255, 0.08) 58%,
        transparent 70%
    );
    transition: opacity 3s ease;
}

/* птицы — редкие силуэты, пролетают днём (opacity через --birds-opacity) */
.sky__birds {
    position: absolute;
    width: 120px;
    height: 60px;
    opacity: var(--birds-opacity);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="60" viewBox="0 0 120 60"><g fill="none" stroke="%232b3038" stroke-width="2" stroke-linecap="round"><path d="M10 22 q6 -8 12 0 q6 -8 12 0"/><path d="M58 36 q5 -7 10 0 q5 -7 10 0" opacity="0.75"/><path d="M92 14 q4 -6 8 0 q4 -6 8 0" opacity="0.6"/></g></svg>');
    background-repeat: no-repeat;
    pointer-events: none;
    transition: opacity 3s ease;
}

.sky__birds--a {
    top: 16%;
    animation: birdsFly 95s linear infinite;
}

.sky__birds--b {
    top: 32%;
    animation: birdsFly 140s linear infinite 45s;
}

@keyframes birdsFly {
    from { transform: translate(-140px, 0) scale(1); }
    to { transform: translate(calc(100vw + 140px), -50px) scale(0.82); }
}

/* падающие звёзды — видны только ночью (opacity завязана на --stars-opacity) */
.sky__shooting {
    position: absolute;
    width: 120px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), transparent 75%);
    opacity: 0;
    pointer-events: none;
}

.sky__shooting--a {
    top: 14%;
    left: 68%;
    animation: shootingA 13s linear infinite 4s;
}

.sky__shooting--b {
    top: 34%;
    left: 22%;
    width: 90px;
    animation: shootingB 19s linear infinite 11s;
}

@keyframes shootingA {
    0%, 95% {
        opacity: 0;
        transform: rotate(155deg) translateX(0);
    }
    96.5% {
        opacity: var(--stars-opacity);
    }
    100% {
        opacity: 0;
        transform: rotate(155deg) translateX(300px);
    }
}

@keyframes shootingB {
    0%, 96% {
        opacity: 0;
        transform: rotate(200deg) translateX(0);
    }
    97.2% {
        opacity: var(--stars-opacity);
    }
    100% {
        opacity: 0;
        transform: rotate(200deg) translateX(260px);
    }
}

/* ---------- sky phases ---------- */

body.sky-morning {
    --sky-top: #86a9d6;
    --sky-mid: #f0ca9e;
    --sky-bottom: #fde4bd;
    --cloud: rgba(255, 238, 218, 0.92);
    --clouds-front: 0.6;
    --clouds-back: 0.4;
    --glow-color: rgba(255, 214, 150, 0.85);
    --glow-opacity: 0.6;
    --atmosphere-a: rgba(255, 239, 216, 0.38);
    --atmosphere-b: rgba(255, 182, 130, 0.18);
}

body.sky-day {
    --birds-opacity: 0.45;
}

body.sky-midday {
    --clouds-front: 0.85;
    --clouds-back: 0.55;
}

body.sky-evening {
    --sky-top: #6d76b4;
    --sky-mid: #e39a83;
    --sky-bottom: #ffd6a0;
    --cloud: rgba(255, 219, 184, 0.92);
    --clouds-front: 0.65;
    --clouds-back: 0.45;
    --glow-color: rgba(255, 165, 96, 0.9);
    --glow-opacity: 0.7;
    --atmosphere-a: rgba(255, 205, 172, 0.3);
    --atmosphere-b: rgba(126, 113, 196, 0.24);
    --ink: #363240;
    --ink-soft: rgba(54, 50, 64, 0.44);
    --ink-faint: rgba(84, 69, 96, 0.045);
    --muted: #746d7e;
    --card: rgba(255, 249, 246, 0.7);
    --card-strong: rgba(255, 250, 247, 0.84);
    --surface: rgba(255, 252, 249, 0.9);
    --line: rgba(76, 61, 86, 0.1);
    --bar: rgba(255, 247, 244, 0.7);
    --accent: #6f68b2;
    --accent-strong: #57518f;
    --accent-soft: rgba(111, 104, 178, 0.11);
    --vignette: rgba(61, 45, 76, 0.12);
    --pencil-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.66),
        0 18px 46px rgba(73, 54, 91, 0.12),
        0 5px 14px rgba(92, 59, 70, 0.06);
    --pencil-shadow-hover:
        inset 0 1px 0 rgba(255, 255, 255, 0.74),
        0 22px 56px rgba(73, 54, 91, 0.16),
        0 7px 18px rgba(92, 59, 70, 0.08);
    --control-shadow: 0 8px 20px rgba(73, 54, 91, 0.08);
}

body.sky-night {
    --sky-top: #070b1d;
    --sky-mid: #101731;
    --sky-bottom: #1a2340;
    --clouds-front: 0;
    --clouds-back: 0;
    --glow-opacity: 0;
    --stars-opacity: 1;

    --ink: #e8edf8;
    --ink-soft: rgba(232, 237, 248, 0.5);
    --ink-faint: rgba(232, 237, 248, 0.07);
    --muted: #a3adc6;
    --paper: #0d1226;
    --card: rgba(15, 21, 42, 0.72);
    --card-strong: rgba(22, 30, 56, 0.88);
    --surface: rgba(31, 40, 72, 0.94);
    --line: rgba(232, 237, 248, 0.16);
    --bar: rgba(10, 15, 32, 0.78);
    --error: #ff9b85;
    --accent: #9ba5ff;
    --accent-strong: #bac1ff;
    --accent-soft: rgba(155, 165, 255, 0.14);
    --atmosphere-a: rgba(92, 110, 205, 0.18);
    --atmosphere-b: rgba(74, 121, 188, 0.14);
    --vignette: rgba(1, 4, 14, 0.42);
    --pencil-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 18px 46px rgba(0, 0, 0, 0.34),
        0 5px 14px rgba(0, 0, 0, 0.22);
    --pencil-shadow-hover:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 22px 56px rgba(0, 0, 0, 0.44),
        0 7px 18px rgba(0, 0, 0, 0.28);
    --control-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

body.sky-night .primary-action img,
body.sky-night .download-rail img {
    filter: brightness(0);
}

body.sky-night .side-nav__item img,
body.sky-night .icon-button img,
body.sky-night .search img,
body.sky-night .heading-icon,
body.sky-night .stub-panel img,
body.sky-night .download-panel img,
body.sky-night .secondary-action img,
body.sky-night .view-all img,
body.sky-night .robux-card img {
    filter: invert(1);
}

body.sky-night .game-art,
body.sky-night .item-art {
    filter: saturate(0.65) brightness(0.98);
}

.auth-wrap,
.app-shell {
    position: relative;
    z-index: 1;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid var(--accent-soft);
    outline-offset: 3px;
}

button:disabled {
    cursor: wait;
    opacity: 0.64;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 236px 1fr;
    grid-template-rows: 70px 1fr;
}

/* ---------- topbar ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    background: var(--bar);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
    backdrop-filter: blur(18px) saturate(1.08);
    box-shadow: 0 10px 30px rgba(28, 42, 78, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
    transform: rotate(-0.8deg);
}

.brand img {
    width: 52px;
    height: auto;
    display: block;
}

.brand span {
    font-family: var(--hand-head);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.topnav__item,
.view-all,
.side-nav__item {
    border: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--sans);
}

.topnav__item {
    position: relative;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 700;
}

.topnav__item::after {
    content: "";
    position: absolute;
    left: -3px;
    right: -3px;
    bottom: 2px;
    height: 3px;
    border-radius: 999px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 160ms ease;
}

.topnav__item:hover::after,
.topnav__item.is-active::after {
    transform: scaleX(1);
}

.search {
    width: min(520px, 32vw);
    min-width: 300px;
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: var(--scrawl-sm);
    background: var(--card);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.search:focus-within {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search img {
    width: 21px;
    height: 21px;
    opacity: 0.75;
}

.search input {
    border: 0;
    outline: 0;
    width: 100%;
    color: var(--ink);
    background: transparent;
    font-size: 16px;
}

.search input::placeholder {
    color: var(--muted);
}

.wallet {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 5px 11px 5px 7px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
    font-family: var(--sans);
    transition: border-color 160ms ease, background 160ms ease;
}

.wallet:hover {
    border-color: var(--line);
    background: var(--card);
}

.wallet__coin {
    position: relative;
    width: 32px;
    height: 32px;
    display: inline-block;
    flex: 0 0 auto;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(145deg, var(--accent), var(--accent-strong));
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.24),
        0 5px 12px rgba(47, 57, 145, 0.24);
    color: transparent;
    font-size: 0;
    transform: rotate(12deg);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.wallet__coin::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    left: 50%;
    top: 50%;
    border-radius: 3px;
    background: var(--surface);
    box-shadow: inset 0 1px 3px rgba(24, 31, 56, 0.28);
    transform: translate(-50%, -50%);
}

.wallet:hover .wallet__coin {
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.3),
        0 7px 16px rgba(47, 57, 145, 0.3);
    transform: rotate(18deg) translateY(-1px);
}

.wallet__coin--big {
    width: 52px;
    height: 52px;
    border-radius: 14px;
}

.wallet__coin--big::after {
    width: 17px;
    height: 17px;
    border-radius: 5px;
}

.icon-button {
    position: relative;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--scrawl-sm);
    background: var(--card);
    box-shadow: var(--control-shadow);
    transition: transform 160ms ease;
}

.icon-button:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.icon-button img {
    width: 23px;
    height: 23px;
    display: block;
}

.icon-button .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    border-radius: 52% 48% 50% 50% / 48% 52% 48% 52%;
    background: var(--ink);
    color: var(--paper);
    font-size: 12px;
    font-weight: 700;
}

/* ---------- sidebar ---------- */

.sidebar {
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    padding: 18px 14px;
    border-right: 1px solid var(--line);
    background: var(--bar);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
    backdrop-filter: blur(18px) saturate(1.08);
    box-shadow: 12px 0 34px rgba(28, 42, 78, 0.07);
}

.user-chip {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: var(--scrawl-md);
    background: transparent;
    color: var(--ink);
    text-align: left;
    transition: border-color 160ms ease, transform 160ms ease;
}

.user-chip:hover {
    border-color: var(--line);
    background: var(--card);
}

.user-chip__avatar {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
}

.user-chip__meta {
    display: grid;
    gap: 2px;
}

.user-chip__meta strong {
    font-family: var(--sans);
    font-size: 16px;
}

.user-chip__meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.side-nav {
    display: grid;
    gap: 5px;
}

.side-nav__item {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--scrawl-md);
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.side-nav__item img {
    width: 23px;
    height: 23px;
    object-fit: contain;
    opacity: 0.85;
}

.side-nav__item:hover,
.side-nav__item.is-active {
    border-color: var(--accent-soft);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.side-nav__item:hover {
    transform: translateX(2px);
}

.side-nav__item:nth-child(even):hover {
    transform: translateX(2px);
}

.download-rail {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 20px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: var(--scrawl-md);
    color: var(--paper);
    background: var(--accent);
    box-shadow: var(--pencil-shadow);
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    transition: background 160ms ease, transform 160ms ease;
}

.download-rail:hover {
    background: var(--accent-strong);
    transform: translateY(-2px);
}

.download-rail img {
    width: 26px;
    filter: brightness(0) invert(1);
}

/* ---------- content / pages ---------- */

.content {
    padding: 30px clamp(20px, 3vw, 48px) 84px;
    overflow: hidden;
}

.page {
    display: none;
    animation: pageIn 320ms ease-out both;
}

.page.is-active {
    display: block;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(7px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-card,
.page-card {
    border: 1px solid var(--line);
    border-radius: var(--scrawl-lg);
    background: var(--card);
    box-shadow: var(--pencil-shadow);
    -webkit-backdrop-filter: blur(18px) saturate(1.06);
    backdrop-filter: blur(18px) saturate(1.06);
}

.hero-card {
    position: relative;
    min-height: 210px;
    display: flex;
    align-items: center;
    gap: 34px;
    padding: 30px 40px;
    background: linear-gradient(135deg, var(--card-strong), var(--card));
}

.avatar-orb {
    flex: 0 0 auto;
    width: 150px;
    height: 150px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 10px 30px rgba(35, 48, 84, 0.1);
}

.avatar-orb--small {
    width: 132px;
    height: 132px;
    border-width: 2.5px;
}

.hero-profile {
    display: grid;
    gap: 10px;
}

.hero-profile p {
    color: var(--muted);
    font-size: 16px;
    font-weight: 600;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-family: var(--hand-head);
    font-size: clamp(34px, 4vw, 46px);
    font-weight: 700;
    letter-spacing: 0.04em;
}

h2 {
    font-family: var(--hand-head);
    font-size: 25px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.empty-state__icon {
    width: 42px;
    height: 42px;
    opacity: 0.7;
}

.primary-action,
.secondary-action {
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: var(--scrawl-sm);
    padding: 0 22px;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    transition: transform 160ms ease;
}

.primary-action:hover,
.secondary-action:hover {
    transform: translateY(-2px);
}

.primary-action:hover {
    background: var(--accent-strong);
}

.primary-action {
    border: 1px solid var(--accent);
    color: var(--paper);
    background: var(--accent);
    box-shadow: var(--pencil-shadow);
    text-decoration: none;
}

.secondary-action {
    border: 1px solid var(--line);
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--pencil-shadow);
}

.primary-action img,
.secondary-action img {
    width: 23px;
    height: 23px;
    object-fit: contain;
}

.primary-action img {
    filter: brightness(0) invert(1);
}

.online-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--green);
}

.stub-panel {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 34px 28px;
    border: 1px dashed var(--ink-soft);
    border-radius: var(--scrawl-md);
    background: var(--card);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
}

.stub-panel img {
    width: 34px;
    height: 34px;
    opacity: 0.6;
}

.home-section {
    margin-top: 32px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 16px;
}

.section-heading h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.heading-icon {
    width: 23px;
    height: 23px;
    opacity: 0.8;
}

.view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px dashed var(--ink-soft);
    padding-bottom: 2px;
}

.view-all img {
    width: 17px;
    opacity: 0.7;
}

/* ---------- game / item cards ---------- */

.popular-grid,
.catalog-grid {
    display: grid;
    gap: 24px;
}

.popular-grid {
    grid-template-columns: repeat(6, minmax(145px, 1fr));
}

.catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.game-card,
.item-card {
    border: 1px solid var(--line);
    border-radius: var(--scrawl-md);
    background: var(--card-strong);
    box-shadow: var(--control-shadow);
    overflow: hidden;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.game-card:nth-child(odd),
.item-card:nth-child(odd) {
    transform: none;
}

.game-card:nth-child(even),
.item-card:nth-child(even) {
    transform: none;
}

.game-card:hover,
.item-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--pencil-shadow-hover);
}

.game-art {
    height: 130px;
    margin: 12px 12px 0;
    border: 0;
    border-radius: var(--scrawl-sm);
    background:
        radial-gradient(circle at 20% 22%, rgba(255,255,255,0.9), transparent 10%),
        linear-gradient(135deg, var(--art-a), var(--art-b));
    filter: saturate(0.6) brightness(1.12);
    position: relative;
    overflow: hidden;
}

.game-art::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(130deg, transparent 0 42%, rgba(255,255,255,0.18) 43% 47%, transparent 48%),
        radial-gradient(circle at 80% 70%, rgba(0,0,0,0.28), transparent 36%);
}

.game-art::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 8%;
    bottom: 0;
    height: 40%;
    background: linear-gradient(180deg, transparent, rgba(10, 18, 30, 0.5));
    clip-path: polygon(0 90%, 14% 45%, 26% 76%, 40% 30%, 54% 78%, 69% 38%, 84% 72%, 100% 20%, 100% 100%, 0 100%);
}

.game-card__body {
    padding: 12px 14px 14px;
}

.game-card h3 {
    margin: 0 0 12px;
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 700;
}

.progress-row,
.stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.progress {
    flex: 1;
    height: 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    width: var(--progress);
    background: repeating-linear-gradient(
        -55deg,
        var(--ink) 0 3px,
        transparent 3px 7px
    );
}

.continue-button {
    border: 1px solid var(--line);
    border-radius: var(--scrawl-sm);
    background: var(--surface);
    padding: 6px 14px;
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 700;
    transition: transform 140ms ease;
}

.continue-button:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.stats-row {
    justify-content: flex-start;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
}

/* ---------- page cards ---------- */

.page-card {
    padding: 32px;
}

.page-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.eyebrow {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.muted {
    max-width: 680px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

/* второстепенный текст — чистым шрифтом, рукописный оставляем заголовкам и навигации */
.muted,
.eyebrow,
.item-price,
.stats-row,
.user-chip__meta span,
.search input,
.auth-field,
.auth-error,
.stub-panel,
.hero-profile p {
    font-family: var(--sans);
}

.item-art {
    height: 150px;
    display: grid;
    place-items: center;
    margin: 12px 12px 0;
    border: 0;
    border-radius: var(--scrawl-sm);
    background:
        radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.35), transparent 42%),
        linear-gradient(135deg, var(--art-a), var(--art-b));
    filter: saturate(0.6) brightness(1.12);
}

.item-art img {
    width: 56px;
    height: 56px;
    filter: brightness(0) invert(1);
    opacity: 0.92;
}

.item-card h3 {
    margin: 14px 16px 5px;
    font-family: var(--sans);
    font-size: 17px;
    font-weight: 700;
}

.item-price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px 16px;
    font-size: 16px;
    font-weight: 700;
}

.item-price .wallet__coin {
    width: 25px;
    height: 25px;
    border-radius: 7px;
}

.item-price .wallet__coin::after {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

/* ---------- live API surfaces ---------- */

.games-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.game-art--image,
.item-art--image {
    background: var(--surface);
    filter: none;
}

.game-art--image::before,
.game-art--image::after {
    display: none;
}

.game-art--image img,
.item-art--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: none;
    opacity: 1;
}

.item-card__body {
    display: grid;
    gap: 8px;
    padding: 14px 16px 16px;
}

.item-card__body h3,
.item-card__body .item-price {
    margin: 0;
}

.item-type {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.card-copy {
    min-height: 40px;
    margin: -4px 0 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.compact-action {
    height: 36px;
    min-width: 84px;
    padding: 0 14px;
    font-size: 13px;
}

button:disabled {
    cursor: default;
    opacity: 0.58;
    transform: none !important;
}

.inline-empty {
    grid-column: 1 / -1;
    padding: 28px;
    border: 1px dashed var(--ink-soft);
    border-radius: var(--scrawl-md);
    color: var(--muted);
    background: var(--card);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 650;
    text-align: center;
}

.avatar-editor,
.friends-page {
    display: grid;
    gap: 24px;
}

.avatar-editor__header {
    margin-bottom: 0;
}

.compatibility-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid rgba(76, 138, 98, 0.36);
    border-radius: 999px 850px 999px 780px;
    color: var(--green);
    background: rgba(76, 138, 98, 0.1);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.avatar-workspace {
    display: grid;
    grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

.avatar-preview-panel,
.avatar-library {
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--control-shadow);
}

.avatar-preview-panel {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 16px;
    padding: 16px;
    border-radius: 19px 15px 21px 16px;
}

.avatar-preview-stage {
    position: relative;
    height: 370px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px 18px 15px 20px;
    background:
        linear-gradient(var(--ink-faint) 1px, transparent 1px),
        linear-gradient(90deg, var(--ink-faint) 1px, transparent 1px),
        radial-gradient(circle at 50% 24%, var(--accent-soft), transparent 42%),
        var(--surface);
    background-size: 24px 24px, 24px 24px, auto, auto;
}

.avatar-preview-stage::after {
    content: "";
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: 17px;
    height: 20px;
    border-radius: 50%;
    background: rgba(37, 42, 52, 0.13);
    filter: blur(8px);
}

.avatar-preview-stage__head,
.avatar-preview-stage__body,
.avatar-preview-stage__arm,
.avatar-preview-stage__leg {
    position: absolute;
    z-index: 2;
    border: 2px solid var(--ink-soft);
    background: var(--card-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 7px 16px rgba(35, 48, 84, 0.12);
}

.avatar-preview-stage__head {
    top: 42px;
    left: 50%;
    width: 74px;
    height: 74px;
    border-radius: 20px 17px 22px 18px;
    transform: translateX(-50%) rotate(-1deg);
}

.avatar-preview-stage__body {
    top: 122px;
    left: 50%;
    width: 108px;
    height: 116px;
    border-radius: 13px 16px 11px 15px;
    background: linear-gradient(145deg, var(--accent), var(--accent-strong));
    transform: translateX(-50%) rotate(0.6deg);
}

.avatar-preview-stage__arm {
    top: 128px;
    width: 34px;
    height: 124px;
    border-radius: 11px 9px 13px 10px;
}

.avatar-preview-stage__arm--left {
    left: calc(50% - 94px);
    transform: rotate(2deg);
}

.avatar-preview-stage__arm--right {
    right: calc(50% - 94px);
    transform: rotate(-2deg);
}

.avatar-preview-stage__leg {
    top: 244px;
    width: 45px;
    height: 102px;
    border-radius: 10px 12px 14px 9px;
    background: #343a48;
}

.avatar-preview-stage__leg--left {
    left: calc(50% - 49px);
    transform: rotate(0.8deg);
}

.avatar-preview-stage__leg--right {
    right: calc(50% - 49px);
    transform: rotate(-0.8deg);
}

.avatar-preview-stage__initial {
    position: absolute;
    z-index: 3;
    top: 61px;
    left: 50%;
    color: var(--ink);
    font: 800 27px var(--hand-head);
    transform: translateX(-50%) rotate(-2deg);
}

.avatar-preview-panel__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.avatar-preview-panel__meta > div {
    display: grid;
    gap: 3px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: var(--scrawl-sm);
    background: var(--surface);
}

.avatar-preview-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.avatar-preview-panel__meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.avatar-redraw {
    width: 100%;
}

.avatar-library {
    min-width: 0;
    overflow: hidden;
    border-radius: 17px 21px 15px 19px;
}

.avatar-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    background: var(--bar);
}

.avatar-tab,
.friends-tab {
    position: relative;
    min-height: 54px;
    border: 0;
    color: var(--muted);
    background: transparent;
    font: 800 14px var(--sans);
    cursor: pointer;
}

.avatar-tab::after,
.friends-tab::after {
    content: "";
    position: absolute;
    right: 16%;
    bottom: 0;
    left: 16%;
    height: 3px;
    border-radius: 999px 700px 999px 620px;
    background: transparent;
    transform: rotate(-0.4deg);
}

.avatar-tab:hover,
.avatar-tab.is-active,
.friends-tab:hover,
.friends-tab.is-active {
    color: var(--ink);
    background: var(--ink-faint);
}

.avatar-tab.is-active::after,
.friends-tab.is-active::after {
    background: var(--accent);
}

.avatar-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 52px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--card-strong);
}

.avatar-subtab {
    min-height: 31px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 999px 760px 999px 680px;
    color: var(--muted);
    background: transparent;
    font: 750 12px var(--sans);
    cursor: pointer;
}

.avatar-subtab:hover,
.avatar-subtab.is-active {
    border-color: var(--line);
    color: var(--ink);
    background: var(--accent-soft);
}

.avatar-library__heading,
.friends-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.avatar-library__heading {
    padding: 22px 20px 14px;
}

.avatar-library__heading h2,
.friends-toolbar h2 {
    margin: 3px 0 0;
}

.avatar-library__heading .eyebrow,
.friends-toolbar .eyebrow {
    margin: 0;
}

.avatar-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 14px;
    padding: 0 20px 22px;
}

.avatar-item-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px 16px 12px 15px;
    background: var(--card-strong);
    box-shadow: 0 7px 16px rgba(35, 48, 84, 0.08);
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.avatar-item-card:hover {
    border-color: var(--accent);
    box-shadow: var(--control-shadow);
    transform: translateY(-2px) rotate(-0.15deg);
}

.avatar-item-card.is-equipped {
    border-color: rgba(89, 100, 215, 0.48);
}

.avatar-item-card__art {
    position: relative;
    height: 150px;
    padding: 8px;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.55), transparent 38%),
        var(--accent-soft);
}

.avatar-item-card__art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.avatar-item-card__check {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px 7px 10px 8px;
    color: var(--paper);
    background: var(--accent);
    box-shadow: var(--control-shadow);
    font-size: 16px;
    font-weight: 900;
}

.avatar-item-card__body {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.avatar-item-card__body h3 {
    min-height: 38px;
    margin: 0;
    overflow: hidden;
    font: 750 14px/1.35 var(--sans);
}

.avatar-item-card__body .compact-action {
    width: 100%;
}

.avatar-compatibility-note {
    margin: -7px 20px 20px;
    padding: 11px 13px;
    border-left: 3px solid var(--accent);
    color: var(--muted);
    background: var(--accent-soft);
    font-size: 12px;
    line-height: 1.45;
}

.import-panel {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(210px, 320px) auto;
    align-items: center;
    gap: 20px;
    padding: 22px;
    border: 1px dashed var(--ink-soft);
    border-radius: var(--scrawl-md);
    background: var(--card);
}

.import-panel h2,
.inventory-heading h2 {
    margin: 0 0 6px;
}

.avatar-import-panel {
    border-style: solid;
}

.inline-field input,
.friend-search input {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: var(--scrawl-sm);
    padding: 0 15px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: var(--control-shadow);
    font: 650 14px var(--sans);
    outline: none;
}

.inline-field input:focus,
.friend-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft), var(--control-shadow);
}

.inline-message {
    padding: 12px 15px;
    border-left: 3px solid var(--accent);
    color: var(--muted);
    background: var(--accent-soft);
    font: 650 14px/1.5 var(--sans);
}

.friend-search {
    display: grid;
    grid-template-columns: minmax(210px, 360px) auto;
    gap: 12px;
    justify-content: start;
}

.friends-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px 18px 12px 16px;
    background: var(--bar);
}

.friends-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-count {
    min-width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface);
    font-size: 11px;
}

.friends-panel {
    display: grid;
    gap: 20px;
}

.friends-panel[hidden] {
    display: none;
}

.friends-toolbar {
    min-height: 54px;
}

.friend-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.friend-search-results:empty {
    display: none;
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.people-grid:empty,
.friend-search-results:empty {
    display: none;
}

.person-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px 18px 13px 16px;
    background: var(--card-strong);
    box-shadow: var(--control-shadow);
}

.person-avatar {
    position: relative;
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--paper);
    background:
        radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 0.42), transparent 33%),
        linear-gradient(145deg, var(--accent), var(--accent-strong));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46), 0 7px 15px rgba(35, 48, 84, 0.13);
    font: 800 23px var(--hand-head);
}

.person-meta {
    min-width: 0;
    display: grid;
    gap: 3px;
    margin-right: auto;
}

.person-meta strong,
.person-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-meta span {
    color: var(--muted);
    font-size: 12px;
}

.person-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
}

.person-actions > button {
    flex: 1;
}

.outgoing-requests {
    display: grid;
    gap: 12px;
    padding-top: 4px;
}

.outgoing-requests[hidden] {
    display: none;
}

.app-notice {
    position: fixed;
    z-index: 100;
    right: 24px;
    bottom: 24px;
    max-width: min(420px, calc(100vw - 32px));
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: var(--scrawl-sm);
    color: var(--ink);
    background: var(--card-strong);
    box-shadow: var(--pencil-shadow-hover);
    font: 700 14px/1.45 var(--sans);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.app-notice.is-error {
    border-left-color: #c84b54;
}

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

/* ---------- robux ---------- */

.robux-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    max-width: 860px;
}

.robux-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 30px 22px;
    border: 1px solid var(--line);
    border-radius: var(--scrawl-md);
    background: var(--card-strong);
    text-align: center;
    box-shadow: var(--control-shadow);
    transform: none;
}

.robux-card:nth-child(even) {
    transform: none;
}

.robux-card--featured {
    background:
        repeating-linear-gradient(-55deg, var(--ink-faint) 0 5px, transparent 5px 12px),
        var(--surface);
    box-shadow: var(--pencil-shadow-hover);
}

.robux-card img {
    width: 44px;
    height: 44px;
    opacity: 0.85;
}

.robux-card h3 {
    margin: 0;
    font-family: var(--hand-head);
    font-size: 30px;
    font-weight: 700;
}

/* ---------- download / profile / empty ---------- */

.download-page {
    display: grid;
    gap: 28px;
}

.download-panel {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 720px;
    padding: 22px;
    border: 1px dashed var(--ink-soft);
    border-radius: var(--scrawl-md);
    background: var(--card);
}

.download-panel img {
    width: 46px;
}

.download-panel .primary-action {
    margin-left: auto;
}

.profile-page {
    display: flex;
    align-items: center;
    gap: 32px;
}

.empty-state {
    min-height: 380px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 14px;
    text-align: center;
}

/* ---------- auth screen ---------- */

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(450px, 94vw);
    display: grid;
    gap: 18px;
    padding: 42px 40px;
    border: 1px solid var(--line);
    border-radius: var(--scrawl-lg);
    background: var(--card-strong);
    box-shadow: var(--pencil-shadow);
    -webkit-backdrop-filter: blur(18px) saturate(1.06);
    backdrop-filter: blur(18px) saturate(1.06);
}

.auth-brand {
    font-family: var(--hand-head);
    font-size: 46px;
    letter-spacing: 0.08em;
    transform: rotate(-0.8deg);
}

.auth-tabs {
    display: flex;
    gap: 24px;
}

.auth-tab {
    position: relative;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 700;
}

.auth-tab::after {
    content: "";
    position: absolute;
    left: -3px;
    right: -3px;
    bottom: 2px;
    height: 4px;
    border-radius: 999px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 160ms ease;
}

.auth-tab.is-active {
    color: var(--ink);
}

.auth-tab:hover::after,
.auth-tab.is-active::after {
    transform: scaleX(1);
}

#authForm {
    display: grid;
    gap: 16px;
}

.auth-field {
    display: grid;
    gap: 6px;
    font-size: 16px;
    font-weight: 700;
}

.auth-field input {
    height: 48px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: var(--scrawl-sm);
    background: var(--surface);
    color: var(--ink);
    font-size: 16px;
    outline: none;
}

.auth-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-error {
    margin: 0;
    color: var(--error);
    font-size: 15px;
    font-weight: 700;
}

.auth-submit {
    justify-self: start;
}

.logout-button {
    margin-top: 16px;
    height: 48px;
    font-size: 15px;
}

/* ---------- responsive ---------- */

@media (max-width: 1280px) {
    .app-shell {
        grid-template-columns: 210px 1fr;
    }

    .popular-grid {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
}

@media (max-width: 860px) {
    .app-shell {
        display: block;
    }

    .topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 14px;
    }

    .topnav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        gap: 22px;
    }

    .search {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
        order: 4;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 2px solid var(--line);
    }

    .side-nav {
        grid-template-columns: repeat(4, 1fr);
    }

    .side-nav__item {
        justify-content: center;
        font-size: 0;
    }

    .download-rail {
        position: static;
        margin-top: 12px;
    }

    .content {
        padding: 22px 14px 90px;
    }

    .hero-card {
        padding: 24px;
        flex-direction: column;
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .popular-grid {
        grid-template-columns: 1fr;
    }

    .catalog-grid,
    .avatar-workspace,
    .import-panel {
        grid-template-columns: 1fr;
    }

    .avatar-preview-panel {
        position: static;
    }

    .avatar-preview-stage {
        height: 330px;
    }

    .avatar-tabs {
        display: flex;
        overflow-x: auto;
    }

    .avatar-tab {
        flex: 0 0 auto;
        min-width: 138px;
        padding: 0 16px;
    }

    .friend-search {
        grid-template-columns: 1fr;
    }

    .page-card__header,
    .avatar-library__heading,
    .friends-toolbar,
    .profile-page {
        align-items: flex-start;
        flex-direction: column;
    }

    .person-card {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .person-avatar {
        width: 54px;
        height: 54px;
    }

    .person-actions {
        width: 100%;
        justify-content: flex-end;
    }

}

@media (prefers-reduced-motion: reduce) {
    .sky::before,
    .sky::after,
    .sky__clouds,
    .sky__stars--twinkle,
    .sky__shooting,
    .sky__birds,
    .page {
        animation: none;
    }
}
