:root {
    --bg: #07131f;
    --bg-soft: #10263d;
    --panel: rgba(10, 27, 43, 0.88);
    --panel-strong: #0d2033;
    --line: rgba(164, 199, 224, 0.16);
    --text: #ecf6ff;
    --muted: #9eb4c7;
    --gold: #f6c15c;
    --mint: #7ef0d1;
    --danger: #ff7a7a;
    --sky: #55c7ff;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(85, 199, 255, 0.22), transparent 28%),
        radial-gradient(circle at 20% 20%, rgba(246, 193, 92, 0.1), transparent 18%),
        linear-gradient(180deg, #05101b 0%, #081b2a 55%, #091d30 100%);
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 92%);
}

.page-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.hero {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 24px;
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(16, 38, 61, 0.92), rgba(9, 25, 40, 0.94)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.05)'%3E%3Cpath d='M10 120c20-24 38-38 64-46 18-6 42-12 76-10'/%3E%3Cpath d='M6 74c28 8 44 16 62 30 20 14 42 26 82 24'/%3E%3C/g%3E%3C/svg%3E");
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -40px -40px auto;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(126, 240, 209, 0.18), transparent 70%);
}

.eyebrow {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: var(--gold);
    font-size: 12px;
    font-weight: 800;
}

.hero h1,
.panel h2 {
    margin: 0;
    font-family: "Unbounded", sans-serif;
    line-height: 1.05;
}

.hero h1 {
    max-width: 12ch;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
}

.hero__lead {
    max-width: 60ch;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.06rem;
}

.hero__actions,
.header-actions,
.flash-stack,
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 14px 22px;
    color: var(--text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    font: inherit;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn--primary {
    background: linear-gradient(135deg, var(--gold), #ef8d43);
    color: #08111a;
    font-weight: 800;
}

.btn--ghost {
    border-color: rgba(255, 255, 255, 0.18);
}

.btn--small {
    padding: 10px 16px;
}

.btn--block {
    width: 100%;
}

.hero__stats,
.dashboard,
.route-sidebar,
.mini-flight-list,
.message-list {
    display: grid;
    gap: 16px;
}

.stat-card,
.panel,
.spec-card,
.message-card,
.enemy-card,
.upgrade-card,
.form-card,
.network-card,
.flash {
    border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(14px);
}

.stat-card {
    border-radius: 24px;
    padding: 22px;
}

.stat-card span,
.spec-card span,
.message-card p,
.route-item p,
.upgrade-card p,
.enemy-card p,
.message-card__meta,
.progress-card__row,
.location-pill,
.field span,
.hint,
.network-card p {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
}

.dashboard {
    margin-top: 22px;
}

.panel {
    border-radius: 30px;
    padding: 26px;
    box-shadow: var(--shadow);
}

.panel__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.badge,
.location-pill,
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.badge--accent {
    background: rgba(126, 240, 209, 0.14);
    color: var(--mint);
}

.flash {
    border-radius: 18px;
    padding: 14px 18px;
}

.flash--success {
    border-color: rgba(126, 240, 209, 0.28);
}

.flash--error {
    border-color: rgba(255, 122, 122, 0.28);
}

.profile-layout,
.map-layout,
.compose-layout,
.auth-layout {
    display: grid;
    gap: 24px;
}

.profile-layout {
    grid-template-columns: 320px 1fr;
}

.auth-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compose-layout {
    grid-template-columns: 1.2fr 0.8fr;
}

.friends-layout,
.tracking-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.chat-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
}

.location-stack {
    display: grid;
    gap: 10px;
}

.form-card {
    padding: 22px;
    border-radius: 24px;
}

.form-card h3 {
    margin-top: 0;
}

.field,
.field-grid {
    display: grid;
    gap: 10px;
}

.field {
    margin-bottom: 14px;
}

.field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    padding: 14px 16px;
    font: inherit;
}

.field option {
    color: #091d30;
}

.field textarea {
    resize: vertical;
}

.search-shell {
    display: grid;
    gap: 18px;
}

.search-field {
    max-width: 560px;
}

.bird-portrait {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    min-height: 360px;
    background:
        radial-gradient(circle at top, rgba(246, 193, 92, 0.35), transparent 35%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--line);
}

.profile-cover {
    position: relative;
    height: 180px;
    border-radius: 26px;
    margin-bottom: 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, rgba(246, 193, 92, 0.45), transparent 25%),
        radial-gradient(circle at 80% 30%, rgba(85, 199, 255, 0.3), transparent 28%),
        linear-gradient(135deg, rgba(19, 44, 69, 0.95), rgba(10, 28, 43, 0.96));
}

.profile-cover__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, transparent 0%, rgba(7, 19, 31, 0.2) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.06)'%3E%3Cpath d='M12 138c28-30 56-44 88-52 20-4 42-6 68-2'/%3E%3Cpath d='M8 90c26 2 48 10 72 22 20 10 46 20 92 18'/%3E%3C/g%3E%3C/svg%3E");
}

.vk-profile-head {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.vk-avatar {
    width: 140px;
    height: 140px;
    border-radius: 28px;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow);
    background: rgba(255, 255, 255, 0.04);
}

.vk-avatar img,
.mini-avatar,
.attachment-box img,
.attachment-box video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

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

.profile-bio {
    margin: 0;
    color: var(--muted);
}

.form-card--profile-edit {
    margin-top: 18px;
}

.bird-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-details {
    display: grid;
    gap: 18px;
}

.progress-card {
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
}

.progress-card__row,
.upgrade-card__footer,
.message-card__head,
.message-card__meta,
.route-item__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.progress {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold), #ef8d43);
}

.spec-grid,
.enemy-grid,
.upgrade-grid,
.network-grid {
    display: grid;
    gap: 14px;
}

.spec-grid,
.upgrade-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.enemy-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.network-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.spec-card,
.enemy-card,
.upgrade-card,
.network-card,
.message-card {
    padding: 18px;
    border-radius: 22px;
}

.spec-card strong {
    display: block;
    margin-top: 10px;
    font-size: 1.3rem;
}

.message-card--danger {
    border-color: rgba(255, 122, 122, 0.34);
}

.message-card--delivered,
.message-card--safe {
    border-color: rgba(126, 240, 209, 0.34);
}

.message-card__body {
    margin: 14px 0 0;
    color: var(--text);
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(85, 199, 255, 0.28), rgba(246, 193, 92, 0.28));
    font-weight: 800;
    flex-shrink: 0;
}

.eta {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(85, 199, 255, 0.14);
    color: var(--sky);
    font-weight: 700;
}

.map-layout {
    grid-template-columns: 1.45fr 0.75fr;
}

.map-box {
    min-height: 520px;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.route-sidebar__summary {
    display: grid;
    gap: 4px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
}

.route-sidebar__summary strong {
    font-size: 2.2rem;
}

.route-item {
    padding: 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
}

.risk-bar {
    margin-top: 12px;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.07);
}

.risk-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--mint), var(--danger));
}

.enemy-card {
    min-height: 160px;
    background:
        radial-gradient(circle at top right, rgba(255, 122, 122, 0.14), transparent 30%),
        var(--panel);
}

.network-card {
    text-decoration: none;
    color: var(--text);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.network-card:hover {
    transform: translateY(-2px);
    border-color: rgba(126, 240, 209, 0.28);
}

.stack-list {
    display: grid;
    gap: 12px;
}

.friend-card,
.message-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.friend-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.friend-state {
    margin-top: 14px;
}

.empty-state {
    padding: 20px;
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.16);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.02);
}

.route-item--active {
    border-color: rgba(126, 240, 209, 0.32);
    box-shadow: inset 0 0 0 1px rgba(126, 240, 209, 0.18);
}

.compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.friend-user-head {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 12px;
    align-items: center;
}

.mini-avatar {
    width: 54px;
    height: 54px;
    border-radius: 18px;
}

.chat-sidebar {
    display: grid;
    gap: 10px;
    align-content: start;
}

.chat-friend {
    display: block;
    padding: 14px 16px;
    border-radius: 18px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.chat-friend--active {
    border-color: rgba(126, 240, 209, 0.28);
    background: rgba(126, 240, 209, 0.08);
}

.chat-main {
    display: grid;
    gap: 16px;
}

.chat-head {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.chat-head h3,
.chat-bubble p {
    margin: 0;
}

.chat-thread {
    display: grid;
    gap: 14px;
    max-height: 720px;
    overflow: auto;
    padding-right: 4px;
}

.chat-bubble {
    max-width: min(82%, 760px);
    padding: 16px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 10px;
}

.chat-bubble--mine {
    justify-self: end;
    background: linear-gradient(135deg, rgba(246, 193, 92, 0.14), rgba(239, 141, 67, 0.08));
}

.chat-bubble--their {
    justify-self: start;
    background: linear-gradient(135deg, rgba(85, 199, 255, 0.12), rgba(85, 199, 255, 0.04));
}

.chat-bubble__meta,
.chat-bubble__foot {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.92rem;
}

.attachment-box {
    display: grid;
    gap: 10px;
}

.attachment-box img,
.attachment-box video {
    max-height: 340px;
    border-radius: 18px;
    border: 1px solid var(--line);
}

.chat-compose {
    margin-top: 4px;
}

.message-actions {
    margin-top: 14px;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.hint {
    font-size: 0.92rem;
}

.leaflet-container {
    background: #c7dff3;
    font-family: "Manrope", sans-serif;
}

.flight-marker {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, var(--gold) 35%, #ef8d43 100%);
    box-shadow: 0 0 0 6px rgba(246, 193, 92, 0.18);
    border: 2px solid rgba(0, 0, 0, 0.25);
}

.user-marker {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, var(--mint) 40%, #2bb5a0 100%);
    box-shadow: 0 0 0 6px rgba(126, 240, 209, 0.18);
    border: 2px solid rgba(0, 0, 0, 0.25);
}

.route-item__head {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 12px;
    align-items: center;
}

.route-item__head img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

.bird-roster {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.bird-tier-card {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.bird-tier-card--locked {
    opacity: 0.72;
}

.bird-tier-portrait {
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 180px;
}

.bird-tier-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bird-tier-meta {
    display: grid;
    gap: 12px;
    align-content: start;
}

.bird-tier-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.bird-tier-head h3 {
    margin: 0;
}

.bird-tier-lock {
    display: flex;
    justify-content: flex-start;
}

.flight-bird-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    padding: 3px;
    background: rgba(8, 17, 26, 0.86);
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

.flight-bird-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

@media (max-width: 1100px) {
    .hero,
    .profile-layout,
    .map-layout,
    .compose-layout,
    .friends-layout,
    .tracking-grid,
    .chat-layout,
    .auth-layout,
    .spec-grid,
    .enemy-grid,
    .upgrade-grid,
    .network-grid,
    .field-grid,
    .compact-grid,
    .bird-roster,
    .bird-tier-card,
    .vk-profile-head {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .page-shell {
        padding: 18px 14px 40px;
    }

    .hero,
    .panel {
        padding: 20px;
        border-radius: 24px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .bird-portrait {
        min-height: 280px;
    }

    .map-box {
        min-height: 380px;
    }
}
