 :root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --accent: #f8fafc;
    --soft-blue: #eff6ff;
    --soft-card: #f8fbff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
    --danger: #b42318;
    --danger-border: #f0c9c6;
    --success: #027a48;
    --success-bg: #ecfdf3;
    --success-border: #abefc6;
    --warning-bg: #fff7ed;
    --warning-border: #fed7aa;
    --warning-text: #9a3412;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
    --radius: 22px;
    --max-width: 1240px;
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  html {
    scroll-behavior: smooth;
  }

  body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
    color: var(--text);
    line-height: 1.6;
  }

  a {
    text-decoration: none;
    color: inherit;
  }

  img {
    max-width: 100%;
    display: block;
  }

  button,
  input,
  textarea {
    font: inherit;
  }

  .container {
    width: min(100% - 32px, var(--max-width));
    margin: 0 auto;
  }

  header {
    background: rgba(255,255,255,0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .topbar {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
  }

  .brand img {
    height: 54px;
    width: auto;
    object-fit: contain;
  }

  nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
  }

  nav a {
    font-size: 15px;
    color: var(--muted);
    font-weight: 600;
    transition: 0.2s ease;
  }

  nav a:hover {
    color: var(--primary);
  }

  .nav-btn {
    background: var(--primary);
    color: var(--white);
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
  }

  .nav-btn:hover {
    background: var(--primary-dark);
    color: var(--white);
  }

  .hero {
    padding: 32px 0 18px;
  }

  .profile-shell {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
  }

  .alert-wrap {
    padding: 18px 28px 0;
  }

  .alert {
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 10px;
    font-weight: 600;
    border: 1px solid transparent;
  }

  .alert.success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success);
  }

  .alert.error {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
  }

  .cover {
    min-height: 270px;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
  }

  .cover img {
    width: 100%;
    height: 270px;
    object-fit: cover;
    object-position: center center;
  }

  .cover-edit-btn,
  .avatar-edit-btn {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
  }

  .cover-edit-btn {
    right: 18px;
    bottom: 18px;
  }

  .profile-main {
    padding: 0 28px 34px;
    margin-top: 18px;
  }

  .profile-top {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    transform: translateY(0);
    margin-top: 18px;
    margin-bottom: 26px;
    align-items: flex-end;
  }

  .profile-identity {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    min-width: 0;
    flex: 1;
  }

  .identity-images {
    display: flex;
    gap: 1px;
    align-items: flex-start;
    flex-shrink: 0;
    position: relative;
  }

  .avatar-wrap {
    position: relative;
    width: 180px;
    height: 180px;
    flex: 0 0 180px;
    flex-shrink: 0;
    margin-top: 0;
  }

  .avatar {
    width: 180px;
    height: 180px;
    border-radius: 28px;
    background: var(--soft-blue);
    border: 5px solid var(--white);
    object-fit: cover;
    box-shadow: var(--shadow);
    flex-shrink: 0;
  }

  .avatar-edit-btn {
    right: -8px;
    bottom: -8px;
    min-height: 36px;
    padding: 8px 12px;
    font-size: 13px;
    background: var(--primary);
  }

  .nft-link {
    display: inline-flex;
    align-items: flex-start;
    justify-content: center;
    width: 160px;
    height: 220px;
    flex: 0 0 220px;
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-top: 0;
    line-height: 0;
    overflow: hidden;
  }

  .nft-card {
    width: 220px;
    height: 220px;
    border-radius: 0;
    background: transparent;
    border: none;
    object-fit: contain;
    object-position: top center;
    box-shadow: none;
    flex-shrink: 0;
    display: block;
  }

  .nft-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--primary);
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    line-height: 1.2;
    width: 220px;
    height: 220px;
    border-radius: 0;
    border: none;
    box-shadow: none;
    flex: 0 0 220px;
    flex-shrink: 0;
    margin-top: 0;
  }

  .identity {
    min-width: 0;
    flex: 1;
    padding-top: 20px;
  }

  .name-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
  }

  .identity h1 {
    font-size: clamp(2rem, 3vw, 2.9rem);
    line-height: 1.05;
    color: var(--secondary);
    margin: 0;
  }

  .tilde-line {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
  }

  .identity .headline {
    color: var(--muted);
    font-size: 1.06rem;
    margin-bottom: 14px;
  }

  .viewer-note {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
  }

  .top-stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 6px;
  }

  .top-stat {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    min-height: 76px;
    padding: 10px 14px;
    border-radius: 16px;
    background: var(--soft-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    transition: 0.2s ease;
  }

  .top-stat:hover {
    border-color: var(--primary);
    background: #f4f9ff;
  }

  .top-stat strong {
    color: var(--secondary);
    font-size: 1rem;
    line-height: 1.1;
    margin-bottom: 3px;
  }

  .top-stat span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
  }

  .profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-self: flex-start;
    justify-content: flex-end;
    max-width: 420px;
    margin-top: 28px;
  }

  .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--secondary);
    font-weight: 700;
    box-shadow: var(--shadow-soft);
    transition: 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
  }

  .action-btn.primary {
    background: var(--primary);
    color: var(--white);
    border-color: transparent;
  }

  .action-btn.secondary-solid {
    background: #eff6ff;
    color: var(--primary);
    border-color: #dbeafe;
  }

  .action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f7fbff;
  }

  .action-btn.primary:hover {
    background: var(--primary-dark);
    color: var(--white);
    border-color: transparent;
  }

  .action-btn.secondary-solid:hover {
    background: #dbeafe;
    color: var(--primary-dark);
    border-color: #bfdbfe;
  }

  .content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    margin-top: 24px;
  }

  .left-col,
  .right-col {
    display: grid;
    gap: 20px;
    align-content: start;
  }

  .card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
  }

  .card h2 {
    font-size: 1.22rem;
    color: var(--secondary);
    margin-bottom: 10px;
  }

  .card p {
    color: var(--muted);
  }

  .subheading {
    color: var(--muted);
    font-size: 0.94rem;
    margin-top: -4px;
    margin-bottom: 16px;
  }

  .info-list {
    display: grid;
    gap: 14px;
    margin-top: 8px;
  }

  .info-item {
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
  }

  .info-item strong {
    display: block;
    color: var(--secondary);
    margin-bottom: 4px;
  }

  .info-item span,
  .info-item a {
    color: var(--muted);
    word-break: break-word;
  }

  .feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
  }

  .feature-grid .card {
    height: 100%;
    margin: 0;
  }

  .education-grid,
  .group-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 12px;
  }

  .education-card,
  .group-card {
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
  }

  .education-card h4,
  .group-card h4 {
    color: var(--secondary);
    font-size: 1rem;
    margin-bottom: 6px;
  }

  .education-card p,
  .group-card p {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 10px;
  }

  .education-meta,
  .group-meta {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
  }

  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.82);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  .modal-overlay.active {
    display: flex;
  }

  .modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .modal-image {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    background: #fff;
  }

  .modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
  }

  .edit-modal-card {
    width: min(100%, 520px);
    background: #ffffff;
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow);
    position: relative;
  }

  .edit-modal-card h3 {
    color: var(--secondary);
    font-size: 1.25rem;
    margin-bottom: 8px;
  }

  .edit-modal-card p {
    color: var(--muted);
    margin-bottom: 14px;
  }

  .edit-form {
    display: grid;
    gap: 14px;
  }

  .edit-form input[type="file"] {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    background: #fff;
  }

  .edit-form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  footer {
    margin-top: 42px;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.8);
  }

  .footer-inner {
    padding: 20px 0 30px;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
  }

  @media (max-width: 1180px) {
    .top-stats {
      grid-template-columns: repeat(3, minmax(110px, 1fr));
    }
  }

  @media (max-width: 1060px) {
    .content-grid {
      grid-template-columns: 1fr;
    }

    .profile-top {
      flex-direction: column;
      align-items: flex-start;
    }

    .profile-actions {
      align-self: flex-start;
      justify-content: flex-start;
      margin-top: 6px;
    }
  }

  @media (max-width: 860px) {
    .feature-grid,
    .education-grid,
    .group-grid {
      grid-template-columns: 1fr;
    }

    .topbar {
      flex-direction: column;
      justify-content: center;
    }

    nav {
      justify-content: center;
    }

    .profile-identity {
      flex-direction: column;
      align-items: flex-start;
    }

    .identity-images {
      align-items: flex-start;
    }

    .top-stats {
      grid-template-columns: repeat(2, minmax(110px, 1fr));
    }
  }

  @media (max-width: 640px) {
    .profile-main {
      padding: 0 18px 24px;
      margin-top: 10px;
    }

    .alert-wrap {
      padding: 18px 18px 0;
    }

    .card {
      padding: 18px;
    }

    .brand img {
      height: 46px;
    }

    .cover,
    .cover img {
      min-height: 220px;
      height: 220px;
    }

    .top-stats {
      grid-template-columns: 1fr 1fr;
      width: 100%;
    }

    .top-stat {
      min-width: 0;
    }

    .name-row {
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
    }

    .identity-images {
      flex-direction: row;
      flex-wrap: wrap;
    }

    .avatar,
    .avatar-wrap {
      width: 104px;
      height: 104px;
      flex-basis: 104px;
    }

    .avatar-wrap,
    .nft-link,
    .nft-card-placeholder {
      margin-top: 0;
    }

    .nft-link,
    .nft-card,
    .nft-card-placeholder {
      width: 120px;
      height: 120px;
      flex-basis: 160px;
    }

    .avatar-edit-btn {
      right: -6px;
      bottom: -6px;
    }
  }


  .stat-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--primary);
    border: 1px solid #dbeafe;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
  }

  .connection-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    max-height: 62vh;
    overflow: auto;
    padding-right: 4px;
  }

  .connection-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fbff;
  }

  .connection-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    object-fit: cover;
    background: var(--soft-blue);
  }

  .connection-name {
    color: var(--secondary);
    font-weight: 800;
    line-height: 1.2;
  }

  .connection-tilde {
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 700;
    margin-top: 2px;
  }

  .connection-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .connection-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
  }

  .mini-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 12px;
    background: var(--white);
    color: var(--secondary);
    font-weight: 800;
    cursor: pointer;
    transition: 0.2s ease;
  }

  .mini-btn.accept {
    background: var(--primary);
    color: var(--white);
    border-color: transparent;
  }

  .mini-btn.decline {
    color: var(--danger);
    border-color: var(--danger-border);
  }

  .mini-btn:hover {
    border-color: var(--primary);
  }

  .empty-modal-state {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fbff;
    color: var(--muted);
    font-weight: 700;
    margin-top: 14px;
  }

  .community-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 12px;
  }

  .community-card {
    display: flex;
    flex-direction: column;
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: 0.2s ease;
    height: 100%;
  }

  .community-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
  }

  .community-card-image {
    width: 100%;
    height: 100px;
    background: #eaf2ff;
    overflow: hidden;
  }

  .community-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .community-card-body {
    padding: 16px 18px;
  }

  .community-card-body h3 {
    color: var(--secondary);
    font-size: 1.02rem;
    margin-bottom: 8px;
  }

  .community-card-body p {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 12px;
  }

  .community-meta {
    color: var(--primary);
    font-size: 0.84rem;
    font-weight: 700;
  }

  .community-role {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
  }
  body.hud-mode{
    min-width:1366px;
    padding:10px !important;
    overflow-x:hidden;
}

body.hud-mode .container,
body.hud-mode .wrap,
body.hud-mode .page-wrap,
body.hud-mode .page-shell,
body.hud-mode .profile-wrap,
body.hud-mode .main-wrap,
body.hud-mode main{
    width:100% !important;
    max-width:none !important;
    margin-left:0 !important;
    margin-right:0 !important;
}

body.hud-mode .profile-card,
body.hud-mode .card,
body.hud-mode .panel{
    width:100% !important;
    max-width:none !important;
}


  